diff options
author | Adrian Torres <atorresj@redhat.com> | 2022-11-10 19:31:31 +0100 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-12-28 12:31:04 +0100 |
commit | 7eee1dca420ee7c4451d24cd32fa08aed0dcbb36 (patch) | |
tree | f643059561e9699cc961845f63faf0a3664ff5d0 /tests/postgres_tests | |
parent | 78f163a4fb3937aca2e71786fbdd51a0ef39629e (diff) | |
download | django-7eee1dca420ee7c4451d24cd32fa08aed0dcbb36.tar.gz |
Fixed #14094 -- Added support for unlimited CharField on PostgreSQL.
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
Diffstat (limited to 'tests/postgres_tests')
-rw-r--r-- | tests/postgres_tests/test_array.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/postgres_tests/test_array.py b/tests/postgres_tests/test_array.py index 86e9d00b41..4808f88689 100644 --- a/tests/postgres_tests/test_array.py +++ b/tests/postgres_tests/test_array.py @@ -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) |