Kaydet (Commit) 2a7c59cd authored tarafından Andriy Sokolovskiy's avatar Andriy Sokolovskiy Kaydeden (comit) Tim Graham

Added missing tests for transforms usage with subquery for PostgreSQL fields

üst 08232ef8
...@@ -228,6 +228,14 @@ class TestQuerying(PostgreSQLTestCase): ...@@ -228,6 +228,14 @@ class TestQuerying(PostgreSQLTestCase):
[instance] [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(PostgreSQLTestCase): class TestChecks(PostgreSQLTestCase):
......
...@@ -132,6 +132,12 @@ class TestQuerying(PostgreSQLTestCase): ...@@ -132,6 +132,12 @@ class TestQuerying(PostgreSQLTestCase):
self.objs[:2] 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(PostgreSQLTestCase): class TestSerialization(PostgreSQLTestCase):
test_data = '[{"fields": {"field": "{\\"a\\": \\"b\\"}"}, "model": "postgres_tests.hstoremodel", "pk": null}]' test_data = '[{"fields": {"field": "{\\"a\\": \\"b\\"}"}, "model": "postgres_tests.hstoremodel", "pk": null}]'
......
...@@ -204,6 +204,12 @@ class TestQuerying(TestCase): ...@@ -204,6 +204,12 @@ class TestQuerying(TestCase):
[self.objs[7], self.objs[8]] [self.objs[7], self.objs[8]]
) )
def test_usage_in_subquery(self):
self.assertSequenceEqual(
JSONModel.objects.filter(id__in=JSONModel.objects.filter(field__c=1)),
self.objs[7:9]
)
@skipUnlessPG94 @skipUnlessPG94
class TestSerialization(TestCase): class TestSerialization(TestCase):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment