Selaa lähdekoodia

Fixing tests name to actually make them run

Test functions name as tests files name must begin with test in order to be run by manage.py test
Yann Weber 9 vuotta sitten
vanhempi
commit
18c497a27b

+ 2
- 2
EditorialModel/lib/component.py Näytä tiedosto

@@ -16,9 +16,9 @@ class EmComponent(object):
16 16
     def __init__(self, id_or_name):
17 17
         if self is EmComponent:
18 18
             raise EnvironmentError('Abstract class')
19
-        if id_or_name is int:
19
+        if type(id_or_name) is int:
20 20
             self.id = id_or_name
21
-        elif id_or_name is str:
21
+        elif type(id_or_name) is str:
22 22
             self.name = id_or_name
23 23
             self.populate()
24 24
         else:

+ 0
- 0
EditorialModel/test/__init__.py Näytä tiedosto


EditorialModel/test.py → EditorialModel/test/test_component.py Näytä tiedosto

@@ -2,8 +2,7 @@ from django.test import TestCase
2 2
 from EditorialModel.lib.component import EmComponent
3 3
 
4 4
 class ComponentTestCase(TestCase):
5
-    def setup(self):
6
-        testComp = EmComponent(2)
7 5
 
8
-    def component_instanciate_with_numeric_id(self):
6
+    def test_component_instanciate_with_numeric_id(self):
7
+        testComp = EmComponent(2)
9 8
         self.assertEqual(testComp.id, 2)

Loading…
Peruuta
Tallenna