summaryrefslogtreecommitdiff
path: root/tests/postgres_tests
diff options
context:
space:
mode:
authorIon Scerbatiuc <ion@rover.com>2015-08-01 07:46:25 -0700
committerTim Graham <timograham@gmail.com>2015-08-12 18:00:26 -0400
commit0cc059cd104cdb70340bd08e597d403d80dc42a6 (patch)
treee9015bb84e07c0a4c407c465faf7e672ebe4c05e /tests/postgres_tests
parentd0bd5330432e1dda519ebd89606bd0980a36dcb4 (diff)
Fixed #25172 -- Fixed check framework to work with multiple databases.
Diffstat (limited to 'tests/postgres_tests')
-rw-r--r--tests/postgres_tests/test_array.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/tests/postgres_tests/test_array.py b/tests/postgres_tests/test_array.py
index 0a41bf1bdd..626a879b77 100644
--- a/tests/postgres_tests/test_array.py
+++ b/tests/postgres_tests/test_array.py
@@ -14,6 +14,7 @@ from . import PostgreSQLTestCase
from .models import (
ArrayFieldSubclass, CharArrayModel, DateTimeArrayModel, IntegerArrayModel,
NestedIntegerArrayModel, NullableIntegerArrayModel, OtherTypesArrayModel,
+ PostgreSQLModel,
)
try:
@@ -246,16 +247,20 @@ class TestQuerying(PostgreSQLTestCase):
class TestChecks(PostgreSQLTestCase):
def test_field_checks(self):
- field = ArrayField(models.CharField())
- field.set_attributes_from_name('field')
- errors = field.check()
+ class MyModel(PostgreSQLModel):
+ field = ArrayField(models.CharField())
+
+ model = MyModel()
+ errors = model.check()
self.assertEqual(len(errors), 1)
self.assertEqual(errors[0].id, 'postgres.E001')
def test_invalid_base_fields(self):
- field = ArrayField(models.ManyToManyField('postgres_tests.IntegerArrayModel'))
- field.set_attributes_from_name('field')
- errors = field.check()
+ class MyModel(PostgreSQLModel):
+ field = ArrayField(models.ManyToManyField('postgres_tests.IntegerArrayModel'))
+
+ model = MyModel()
+ errors = model.check()
self.assertEqual(len(errors), 1)
self.assertEqual(errors[0].id, 'postgres.E002')