mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #24844 -- Corrected has_changed implementation for HStoreField.
Backport of 43b2d88a5b from master
This commit is contained in:
committed by
Tim Graham
parent
2aa2b9f291
commit
62c19a21b6
@@ -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):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user