18 lines
498 B
Python
18 lines
498 B
Python
|
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)
|