openbackloggery/collection/figurines/tests/test_set.py

18 lines
498 B
Python
Raw Normal View History

2017-09-18 19:51:10 +00:00
from django.test import TestCase
from figurines.models import Set
class SetTest(TestCase):
def setUp(self):
Set.objects.create(name='DimDim')
Set.objects.create(name='Rainbow')
Set.objects.create(name='Mystery')
def test_sorted_sets(self):
sets = list(Set.objects.all().values_list('name', flat=True))
sorted_sets = list(
Set.objects.all().order_by('name').values_list('name', flat=True))
self.assertEqual(sets, sorted_sets)