summaryrefslogtreecommitdiff
path: root/tests/postgres_tests
diff options
context:
space:
mode:
authoranna <annarschneider@gmail.com>2016-04-03 12:39:18 +0200
committerMarkus Holtermann <info@markusholtermann.eu>2016-04-03 16:32:30 +0200
commitb28c60529bfa94702a50990fc2d40faa837fca9c (patch)
tree33928b3fa7f3622ea2bccf032d3cda9ac9da7573 /tests/postgres_tests
parent319b7112d8aa4a5fc38e9a8af2137d0074011439 (diff)
Fixed #26101 -- Allowed introspection of base_field.model in RangeField
Used the same test and fix as in #25867. This required initializing base_field in RangeField.__init__, not when setting the attribute.
Diffstat (limited to 'tests/postgres_tests')
-rw-r--r--tests/postgres_tests/test_ranges.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/postgres_tests/test_ranges.py b/tests/postgres_tests/test_ranges.py
index 692fb54a89..dbf10bcf09 100644
--- a/tests/postgres_tests/test_ranges.py
+++ b/tests/postgres_tests/test_ranges.py
@@ -80,6 +80,12 @@ class TestSaveLoad(PostgreSQLTestCase):
loaded = RangesModel.objects.get()
self.assertIsNone(loaded.ints)
+ def test_model_set_on_base_field(self):
+ instance = RangesModel()
+ field = instance._meta.get_field('ints')
+ self.assertEqual(field.model, RangesModel)
+ self.assertEqual(field.base_field.model, RangesModel)
+
class TestQuerying(PostgreSQLTestCase):