def test_disabled_auth(self):
self.heartbeat['auth'] = {'disable': True}
# Make factory without auth header
self.factory = RequestFactory()
request = self.factory.get(reverse('1337'))
response = details(request)
assert response.status_code == 200
assert response['content-type'] == 'application/json'
json_response = json.loads(response.content.decode('utf-8'))
assert json_response['test_views']['ping'] == 'pong'
评论列表
文章目录