summaryrefslogtreecommitdiff
path: root/tests/postgres_tests
diff options
context:
space:
mode:
authorAndrea Grandi <a.grandi@gmail.com>2015-05-24 15:56:48 +0100
committerTim Graham <timograham@gmail.com>2015-05-25 21:10:07 -0400
commit62c19a21b65985b9d54eb1c5a1cf747fe7a54c84 (patch)
tree491ab178181d6d44a13fca1703a23621d41200dc /tests/postgres_tests
parent2aa2b9f291e43bffc07c535dc5906094e6df0bb7 (diff)
Fixed #24844 -- Corrected has_changed implementation for HStoreField.
Backport of 43b2d88a5b9cfb151ccf7ac861f2750e70c0e2c4 from master
Diffstat (limited to 'tests/postgres_tests')
-rw-r--r--tests/postgres_tests/test_hstore.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/postgres_tests/test_hstore.py b/tests/postgres_tests/test_hstore.py
index 8b2cc883dc..b36333d90c 100644
--- a/tests/postgres_tests/test_hstore.py
+++ b/tests/postgres_tests/test_hstore.py
@@ -4,6 +4,7 @@ from django.contrib.postgres import forms
from django.contrib.postgres.fields import HStoreField
from django.contrib.postgres.validators import KeysValidator
from django.core import exceptions, serializers
+from django.forms import Form
from django.test import TestCase
from .models import HStoreModel
@@ -174,6 +175,12 @@ class TestFormField(TestCase):
form_field = model_field.formfield()
self.assertIsInstance(form_field, forms.HStoreField)
+ def test_empty_field_has_not_changed(self):
+ class HStoreFormTest(Form):
+ f1 = HStoreField()
+ form_w_hstore = HStoreFormTest()
+ self.assertFalse(form_w_hstore.has_changed())
+
class TestValidator(TestCase):