Tests : ajout d'un test sur le tri des Consoles
This commit is contained in:
parent
235cb0e453
commit
b95407bb70
@ -1,3 +0,0 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
BIN
collection/games/tests/.test_console.py.swp
Normal file
BIN
collection/games/tests/.test_console.py.swp
Normal file
Binary file not shown.
0
collection/games/tests/__init__.py
Normal file
0
collection/games/tests/__init__.py
Normal file
20
collection/games/tests/test_console.py
Normal file
20
collection/games/tests/test_console.py
Normal file
@ -0,0 +1,20 @@
|
||||
from django.test import TestCase
|
||||
from games.models import Console
|
||||
|
||||
|
||||
class ConsoleTest(TestCase):
|
||||
"""
|
||||
Console Model
|
||||
"""
|
||||
|
||||
def setUp(self):
|
||||
Console.objects.create(name='GP2X')
|
||||
Console.objects.create(name='3DS')
|
||||
|
||||
|
||||
def test_console_are_sorted_by_name(self):
|
||||
consoles = list(Console.objects.all().values_list('name', flat=True))
|
||||
sorted_consoles = list(
|
||||
Console.objects.all().order_by('name').values_list(
|
||||
'name', flat=True))
|
||||
self.assertEqual(consoles, sorted_consoles)
|
Loading…
Reference in New Issue
Block a user