2018-10-23 22:43:51 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
from __future__ import absolute_import
|
|
|
|
|
2020-03-26 06:33:06 +00:00
|
|
|
from .helper import DashboardTestCase
|
2018-10-23 22:43:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
class RequestsTest(DashboardTestCase):
|
|
|
|
def test_gzip(self):
|
|
|
|
self._get('/api/summary')
|
|
|
|
self.assertHeaders({
|
|
|
|
'Content-Encoding': 'gzip',
|
|
|
|
'Content-Type': 'application/json',
|
|
|
|
})
|
|
|
|
|
|
|
|
def test_force_no_gzip(self):
|
|
|
|
self._get('/api/summary', params=dict(
|
|
|
|
headers={'Accept-Encoding': 'identity'}
|
|
|
|
))
|
|
|
|
self.assertNotIn('Content-Encoding', self._resp.headers)
|
|
|
|
self.assertHeaders({
|
|
|
|
'Content-Type': 'application/json',
|
|
|
|
})
|