diff options
| author | Andriy Sokolovskiy <me@asokolovskiy.com> | 2015-06-04 16:15:25 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-06-06 09:12:07 -0400 |
| commit | 66496c840375834b173c506c033d6f971ccaacea (patch) | |
| tree | eada28196ba9025341808566168ad4761a876e1d /tests/postgres_tests | |
| parent | b4b13759f82e9e09951bb72875b1c6e384dca6a9 (diff) | |
[1.8.x] Added missing tests for transforms usage with subquery for PostgreSQL fields
Backport of 2a7c59cd885b4c9f0584015c34c17c9ebca6d417 from master
Diffstat (limited to 'tests/postgres_tests')
| -rw-r--r-- | tests/postgres_tests/test_array.py | 8 | ||||
| -rw-r--r-- | tests/postgres_tests/test_hstore.py | 6 |
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/postgres_tests/test_array.py b/tests/postgres_tests/test_array.py index 35a3bffd58..0dffbaf0a2 100644 --- a/tests/postgres_tests/test_array.py +++ b/tests/postgres_tests/test_array.py @@ -223,6 +223,14 @@ class TestQuerying(TestCase): [instance] ) + def test_usage_in_subquery(self): + self.assertSequenceEqual( + NullableIntegerArrayModel.objects.filter( + id__in=NullableIntegerArrayModel.objects.filter(field__len=3) + ), + [self.objs[3]] + ) + class TestChecks(TestCase): diff --git a/tests/postgres_tests/test_hstore.py b/tests/postgres_tests/test_hstore.py index b36333d90c..6063e74483 100644 --- a/tests/postgres_tests/test_hstore.py +++ b/tests/postgres_tests/test_hstore.py @@ -122,6 +122,12 @@ class TestQuerying(TestCase): self.objs[:2] ) + def test_usage_in_subquery(self): + self.assertSequenceEqual( + HStoreModel.objects.filter(id__in=HStoreModel.objects.filter(field__a='b')), + self.objs[:2] + ) + class TestSerialization(TestCase): test_data = '[{"fields": {"field": "{\\"a\\": \\"b\\"}"}, "model": "postgres_tests.hstoremodel", "pk": null}]' |
