Answer the question
In order to leave comments, you need to log in
Error in test AttributeError: `bytes` has no attribute `status_code`?
The code:
def test_no_question(self):
response = self.client.get(reverse('index'))
self.assertEqual(response.status_code.decode, 200)
self.assertContains(response.content, "No tes are avialiable")
self.assertQuerysetEqual(response.context_data['question_list'], [])
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question