def test_right_form_field_used(self):
from jsonfield_compat.util import django_supports_native_jsonfield, is_db_postgresql
if is_db_postgresql() and django_supports_native_jsonfield():
from jsonfield_compat.forms import JSONFormField
from django.contrib.postgres.fields import JSONField as _JSONFormField
self.assertTrue(JSONFormField is _JSONFormField)
else:
from jsonfield_compat.forms import JSONFormField
from jsonfield.forms import JSONFormField as _JSONFormField
self.assertTrue(JSONFormField is _JSONFormField)
评论列表
文章目录