diff options
Diffstat (limited to 'tests/postgres_tests/test_array.py')
| -rw-r--r-- | tests/postgres_tests/test_array.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/postgres_tests/test_array.py b/tests/postgres_tests/test_array.py index 4776bda934..03ffa4d637 100644 --- a/tests/postgres_tests/test_array.py +++ b/tests/postgres_tests/test_array.py @@ -309,6 +309,22 @@ class TestQuerying(PostgreSQLTestCase): self.objs[2:3] ) + def test_order_by_slice(self): + more_objs = ( + NullableIntegerArrayModel.objects.create(field=[1, 637]), + NullableIntegerArrayModel.objects.create(field=[2, 1]), + NullableIntegerArrayModel.objects.create(field=[3, -98123]), + NullableIntegerArrayModel.objects.create(field=[4, 2]), + ) + self.assertSequenceEqual( + NullableIntegerArrayModel.objects.order_by('field__1'), + [ + more_objs[2], more_objs[1], more_objs[3], self.objs[2], + self.objs[3], more_objs[0], self.objs[4], self.objs[1], + self.objs[0], + ] + ) + @unittest.expectedFailure def test_slice_nested(self): instance = NestedIntegerArrayModel.objects.create(field=[[1, 2], [3, 4]]) |
