mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-15 02:33:13 +00:00
Deterministic ordering for tags
This commit is contained in:
parent
1d0fa2a3bf
commit
5b123ca5f4
2 changed files with 2 additions and 2 deletions
|
|
@ -56,7 +56,7 @@ class StreamField(Field):
|
|||
|
||||
class TagsField(Field):
|
||||
def to_representation(self, value):
|
||||
return list(value.all().values_list('name', flat=True))
|
||||
return list(value.all().order_by('name').values_list('name', flat=True))
|
||||
|
||||
|
||||
class BaseSerializer(serializers.ModelSerializer):
|
||||
|
|
|
|||
|
|
@ -586,7 +586,7 @@ class TestPageDetail(TestCase):
|
|||
self.assertEqual(content['date'], '2013-12-02')
|
||||
|
||||
# Check that the tags were serialised properly
|
||||
self.assertEqual(content['tags'], ['wagtail', 'bird'])
|
||||
self.assertEqual(content['tags'], ['bird', 'wagtail'])
|
||||
|
||||
# Check that the feed image was serialised properly
|
||||
self.assertIsInstance(content['feed_image'], dict)
|
||||
|
|
|
|||
Loading…
Reference in a new issue