From a7b7f27c05244d69a11545261eb3bbd73791b3d2 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Fri, 7 Aug 2015 13:06:56 -0400 Subject: Fixed #25233 -- Fixed HStoreField.has_changed() handling of initial values. Thanks Simon Charette for review. --- tests/postgres_tests/test_hstore.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/postgres_tests') diff --git a/tests/postgres_tests/test_hstore.py b/tests/postgres_tests/test_hstore.py index 81ee02dafa..68c54918a1 100644 --- a/tests/postgres_tests/test_hstore.py +++ b/tests/postgres_tests/test_hstore.py @@ -206,6 +206,12 @@ class TestFormField(PostgreSQLTestCase): form_w_hstore = HStoreFormTest({'f1': '{"a": 2}'}, initial={'f1': '{"a": 1}'}) self.assertTrue(form_w_hstore.has_changed()) + form_w_hstore = HStoreFormTest({'f1': '{"a": 1}'}, initial={'f1': {"a": 1}}) + self.assertFalse(form_w_hstore.has_changed()) + + form_w_hstore = HStoreFormTest({'f1': '{"a": 2}'}, initial={'f1': {"a": 1}}) + self.assertTrue(form_w_hstore.has_changed()) + class TestValidator(PostgreSQLTestCase): -- cgit v1.3