Browse Source

em_test update + bugfix in tests

Yann Weber 9 years ago
parent
commit
ece5029d66
4 changed files with 13 additions and 6 deletions
  1. 11
    4
      em_test.py
  2. BIN
      examples/em_test.pickle
  3. BIN
      tests/editorial_model.pickle
  4. 2
    2
      tests/migration_handler/test_db_init.py

+ 11
- 4
em_test.py View File

@@ -153,7 +153,8 @@ text.new_field(    'subtitle',
153 153
                     },
154 154
                     group = editorial_group,
155 155
                     data_handler = 'varchar',
156
-                    nullable = True)
156
+                    nullable = True,
157
+                    default = None)
157 158
 
158 159
 # Classe collection
159 160
 collection = em.new_class(  'collection',
@@ -205,7 +206,9 @@ section.new_field(  'childs',
205 206
                     group = editorial_group,
206 207
                     data_handler = 'hierarch',
207 208
                     allowed_classes = [subsection],
208
-                    back_reference = ('subsection', 'parent'))
209
+                    back_reference = ('subsection', 'parent'),
210
+                    default = None,
211
+                    nullable = True)
209 212
 
210 213
 subsection.new_field(   'parent',
211 214
                         display_name = 'Parent',
@@ -286,7 +289,9 @@ text.new_field( 'linked_persons',
286 289
                 data_handler = 'list',
287 290
                 back_reference = ('Person', 'linked_texts'),
288 291
                 group = editorial_person_group,
289
-                allowed_classes = [person])
292
+                allowed_classes = [person],
293
+                default = None,
294
+                nullable = True)
290 295
 
291 296
 #####################
292 297
 # Index classes     # <--- Note :   using a different datasource for testing
@@ -327,7 +332,9 @@ text.new_field( 'indexes',
327 332
         'fre': 'Indexes'},
328 333
     data_handler = 'list',
329 334
     back_reference = ('Indexabs', 'texts'),
330
-    allowed_classes = [index_abstract])
335
+    allowed_classes = [index_abstract],
336
+    default = None,
337
+    nullable = True)
331 338
 
332 339
 index_abstract.new_field( 'texts',
333 340
     display_name = {

BIN
examples/em_test.pickle View File


BIN
tests/editorial_model.pickle View File


+ 2
- 2
tests/migration_handler/test_db_init.py View File

@@ -6,7 +6,7 @@ class MongoDbMigrationHandlerTestCase(unittest.TestCase):
6 6
 
7 7
     def test_check_connection_args(self):
8 8
         empty_connection_args = {}
9
-        with self.assertRaises(MigrationHandlerError):
9
+        with self.assertRaises(TypeError):
10 10
             MigrationHandler(empty_connection_args)
11 11
 
12 12
         bad_connection_args_dicts = [
@@ -15,7 +15,7 @@ class MongoDbMigrationHandlerTestCase(unittest.TestCase):
15 15
             {'host': 'localhost', 'port': 28015, 'login':'lodel', 'password': 'lap'}
16 16
         ]
17 17
         for bad_connection_args_dict in bad_connection_args_dicts:
18
-            with self.assertRaises(MigrationHandlerError):
18
+            with self.assertRaises(TypeError):
19 19
                 MigrationHandler(bad_connection_args_dict)
20 20
 
21 21
     ## @todo pass the connection arguments in the settings

Loading…
Cancel
Save