mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #23620 -- Used more specific assertions in the Django test suite.
This commit is contained in:
committed by
Tim Graham
parent
c0c78f1b70
commit
f7969b0920
@@ -955,7 +955,7 @@ class ContextTests(TestCase):
|
||||
"Context variables can be retrieved from a single context"
|
||||
response = self.client.get("/request_data/", data={'foo': 'whiz'})
|
||||
self.assertEqual(response.context.__class__, Context)
|
||||
self.assertTrue('get-foo' in response.context)
|
||||
self.assertIn('get-foo', response.context)
|
||||
self.assertEqual(response.context['get-foo'], 'whiz')
|
||||
self.assertEqual(response.context['request-foo'], 'whiz')
|
||||
self.assertEqual(response.context['data'], 'sausage')
|
||||
@@ -971,7 +971,7 @@ class ContextTests(TestCase):
|
||||
response = self.client.get("/request_data_extended/", data={'foo': 'whiz'})
|
||||
self.assertEqual(response.context.__class__, ContextList)
|
||||
self.assertEqual(len(response.context), 2)
|
||||
self.assertTrue('get-foo' in response.context)
|
||||
self.assertIn('get-foo', response.context)
|
||||
self.assertEqual(response.context['get-foo'], 'whiz')
|
||||
self.assertEqual(response.context['request-foo'], 'whiz')
|
||||
self.assertEqual(response.context['data'], 'bacon')
|
||||
|
||||
Reference in New Issue
Block a user