diff options
| author | Matthew Wilkes <git@matthewwilkes.name> | 2017-06-18 16:53:40 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-02-10 19:08:55 -0500 |
| commit | 2162f0983de0dfe2178531638ce7ea56f54dd4e7 (patch) | |
| tree | bb1e859159200fa7ebeeaa02ec3908e1cf5d2655 /tests/postgres_tests/test_hstore.py | |
| parent | bf26f66029bca94b007a2452679ac004598364a6 (diff) | |
Fixed #24747 -- Allowed transforms in QuerySet.order_by() and distinct(*fields).
Diffstat (limited to 'tests/postgres_tests/test_hstore.py')
| -rw-r--r-- | tests/postgres_tests/test_hstore.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/postgres_tests/test_hstore.py b/tests/postgres_tests/test_hstore.py index 069e570f51..b58e5e5e20 100644 --- a/tests/postgres_tests/test_hstore.py +++ b/tests/postgres_tests/test_hstore.py @@ -148,6 +148,18 @@ class TestQuerying(HStoreTestCase): self.objs[:2] ) + def test_order_by_field(self): + more_objs = ( + HStoreModel.objects.create(field={'g': '637'}), + HStoreModel.objects.create(field={'g': '002'}), + HStoreModel.objects.create(field={'g': '042'}), + HStoreModel.objects.create(field={'g': '981'}), + ) + self.assertSequenceEqual( + HStoreModel.objects.filter(field__has_key='g').order_by('field__g'), + [more_objs[1], more_objs[2], more_objs[0], more_objs[3]] + ) + def test_keys_contains(self): self.assertSequenceEqual( HStoreModel.objects.filter(field__keys__contains=['a']), |
