We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 02b22bd commit f3b1bb6Copy full SHA for f3b1bb6
tests/test_hstore_required.py
@@ -126,7 +126,7 @@ def test_rename_field():
126
assert len(calls.get('DROP CONSTRAINT', [])) == 0
127
128
129
-def test_enforcement():
+def test_required_enforcement():
130
"""Tests whether the constraints are actually
131
properly enforced."""
132
@@ -136,3 +136,14 @@ def test_enforcement():
136
137
with pytest.raises(IntegrityError):
138
model.objects.create(title={'ar': 'hello'})
139
+
140
141
+def test_no_required():
142
+ """Tests whether setting `required` to False casues
143
+ no requiredness constraints to be added."""
144
145
+ model = get_fake_model({
146
+ 'title': HStoreField(required=False)
147
+ })
148
149
+ model.objects.create(title={'ar': 'hello'})
0 commit comments