def test_request_get_template_response():
class TheCase(ViewTestCase, TestCase):
view_class = views.GenericTemplateView
user = User(username='user')
case = TheCase()
response = case.request(user=user)
assert case._request.user == user
assert case._request.method == 'GET'
assert response.status_code == 200
assert response.content == '<h1>test-id</h1>\n'
assert response.location is None
assert 'content-type' in response.headers
assert len(response.messages) == 0
评论列表
文章目录