|
@@ -39,18 +39,8 @@ def setUpModule():
|
39
|
39
|
|
40
|
40
|
The goal are to overwrtie Db configs, and prepare objects for test_case initialisation
|
41
|
41
|
"""
|
42
|
|
- #Overwritting db confs to make tests
|
43
|
|
-
|
|
42
|
+ cleanDb(TEST_COMPONENT_DBNAME)
|
44
|
43
|
|
45
|
|
- """
|
46
|
|
- settings.LODEL2SQLWRAPPER['db'] = {
|
47
|
|
- 'default': {
|
48
|
|
- 'ENGINE': 'sqlite',
|
49
|
|
- 'NAME': TEST_COMPONENT_DBNAME
|
50
|
|
- }
|
51
|
|
- }
|
52
|
|
-
|
53
|
|
- """
|
54
|
44
|
setDbConf(TEST_COMPONENT_DBNAME)
|
55
|
45
|
#Disable logging but CRITICAL
|
56
|
46
|
logging.basicConfig(level=logging.CRITICAL)
|
|
@@ -440,7 +430,14 @@ class TestCreate(ComponentTestCase):
|
440
|
430
|
self.fail("create raises but should return the existing EmComponent instance instead")
|
441
|
431
|
self.assertEqual(tc.uid, tc2.uid, "Created twice the same EmComponent")
|
442
|
432
|
pass
|
443
|
|
-
|
|
433
|
+
|
|
434
|
+ def testGetMaxRank(self):
|
|
435
|
+ old = EmTestComp.get_max_rank('f')
|
|
436
|
+ EmTestComp.create(name="foobartest", rank_fam = 'f')
|
|
437
|
+ n = EmTestComp.get_max_rank('f')
|
|
438
|
+ self.assertEqual(old+1, n, "Excepted value was "+str(old+1)+" but got "+str(n))
|
|
439
|
+ self.assertEqual(EmTestComp.get_max_rank('z'), -1)
|
|
440
|
+ pass
|
444
|
441
|
|
445
|
442
|
#====================#
|
446
|
443
|
# EmComponent.delete #
|