summaryrefslogtreecommitdiff
path: root/tests/template_tests/test_context.py
diff options
context:
space:
mode:
authorBaptiste Mispelon <bmispelon@gmail.com>2014-02-15 22:58:03 +0100
committerBaptiste Mispelon <bmispelon@gmail.com>2014-02-15 22:58:03 +0100
commit9db4271bd11ac23a5a5652bbcdf8fb6d4b997651 (patch)
tree07f0d797b0c9f34726c0ec1de68f4179d899cedc /tests/template_tests/test_context.py
parentf46ef750b9d08ef6081ab57428201028d77adb53 (diff)
Fixed bad comparison logic introduced in d97bf2e9c8971764690caaf81a0914bc368d6b02.
Refs #21765. Thanks to kezabelle for the quick report and to onjin for providing the patch.
Diffstat (limited to 'tests/template_tests/test_context.py')
-rw-r--r--tests/template_tests/test_context.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/template_tests/test_context.py b/tests/template_tests/test_context.py
index f810feda74..64d0df8d10 100644
--- a/tests/template_tests/test_context.py
+++ b/tests/template_tests/test_context.py
@@ -53,4 +53,22 @@ class ContextTests(TestCase):
def test_context_comparable(self):
test_data = {'x': 'y', 'v': 'z', 'd': {'o': object, 'a': 'b'}}
- self.assertEquals(Context(test_data), Context(test_data))
+ self.assertEqual(Context(test_data), Context(test_data))
+
+ # Regression test for #21765
+ a = Context()
+ b = Context()
+ self.assertEqual(a, b)
+
+ # update only a
+ a.update({'a': 1})
+ self.assertNotEqual(a, b)
+
+ # update both to check regression
+ a.update({'c': 3})
+ b.update({'c': 3})
+ self.assertNotEqual(a, b)
+
+ # make contexts equals again
+ b.update({'a': 1})
+ self.assertEqual(a, b)