ソースを参照

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年前
コミット
18c497a27b
3個のファイルの変更4行の追加5行の削除
  1. 2
    2
      EditorialModel/lib/component.py
  2. 0
    0
      EditorialModel/test/__init__.py
  3. 2
    3
      EditorialModel/test/test_component.py

+ 2
- 2
EditorialModel/lib/component.py ファイルの表示

@@ -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 ファイルの表示


EditorialModel/test.py → EditorialModel/test/test_component.py ファイルの表示

@@ -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)

読み込み中…
キャンセル
保存