Browse Source

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 years ago
parent
commit
18c497a27b

+ 2
- 2
EditorialModel/lib/component.py View File

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

+ 0
- 0
EditorialModel/test/__init__.py View File


EditorialModel/test.py → EditorialModel/test/test_component.py View File

2
 from EditorialModel.lib.component import EmComponent
2
 from EditorialModel.lib.component import EmComponent
3
 
3
 
4
 class ComponentTestCase(TestCase):
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
         self.assertEqual(testComp.id, 2)
8
         self.assertEqual(testComp.id, 2)

Loading…
Cancel
Save