mirror of
https://github.com/django/django.git
synced 2025-07-28 23:54:02 +00:00
Fixed #14094 -- Added support for unlimited CharField on PostgreSQL.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
This commit is contained in:
parent
78f163a4fb
commit
7eee1dca42
12 changed files with 78 additions and 15 deletions
|
@ -776,12 +776,12 @@ class TestOtherTypesExactQuerying(PostgreSQLTestCase):
|
|||
class TestChecks(PostgreSQLSimpleTestCase):
|
||||
def test_field_checks(self):
|
||||
class MyModel(PostgreSQLModel):
|
||||
field = ArrayField(models.CharField())
|
||||
field = ArrayField(models.CharField(max_length=-1))
|
||||
|
||||
model = MyModel()
|
||||
errors = model.check()
|
||||
self.assertEqual(len(errors), 1)
|
||||
# The inner CharField is missing a max_length.
|
||||
# The inner CharField has a non-positive max_length.
|
||||
self.assertEqual(errors[0].id, "postgres.E001")
|
||||
self.assertIn("max_length", errors[0].msg)
|
||||
|
||||
|
@ -837,12 +837,12 @@ class TestChecks(PostgreSQLSimpleTestCase):
|
|||
"""
|
||||
|
||||
class MyModel(PostgreSQLModel):
|
||||
field = ArrayField(ArrayField(models.CharField()))
|
||||
field = ArrayField(ArrayField(models.CharField(max_length=-1)))
|
||||
|
||||
model = MyModel()
|
||||
errors = model.check()
|
||||
self.assertEqual(len(errors), 1)
|
||||
# The inner CharField is missing a max_length.
|
||||
# The inner CharField has a non-positive max_length.
|
||||
self.assertEqual(errors[0].id, "postgres.E001")
|
||||
self.assertIn("max_length", errors[0].msg)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue