Tests : ajout d'un test sur le tri des Consoles
parent
235cb0e453
commit
b95407bb70
|
@ -1,3 +0,0 @@
|
|||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
Binary file not shown.
|
@ -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