Nouvelle collection : les figurines
This commit is contained in:
0
collection/figurines/tests/__init__.py
Normal file
0
collection/figurines/tests/__init__.py
Normal file
17
collection/figurines/tests/test_set.py
Normal file
17
collection/figurines/tests/test_set.py
Normal file
@ -0,0 +1,17 @@
|
||||
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)
|
Reference in New Issue
Block a user