server/test/unittest_migractions.py
changeset 10921 977def81780a
parent 10917 edea9c324396
child 10951 ef1cfc80d51c
--- a/server/test/unittest_migractions.py	Tue Nov 24 16:01:43 2015 +0100
+++ b/server/test/unittest_migractions.py	Thu Sep 24 11:26:11 2015 +0200
@@ -733,6 +733,12 @@
             self.assertNotIn('%secrit_par' % SQL_PREFIX,
                              self.table_schema(mh, '%sPersonne' % SQL_PREFIX))
 
+    def test_drop_inlined_rdef_delete_data(self):
+        with self.mh() as (cnx, mh):
+            note = mh.cmd_create_entity('Note', ecrit_par=cnx.user.eid)
+            mh.commit()
+            mh.drop_relation_definition('Note', 'ecrit_par', 'CWUser')
+            self.assertFalse(mh.sqlexec('SELECT * FROM cw_Note WHERE cw_ecrit_par IS NOT NULL'))
 
 class MigrationCommandsComputedTC(MigrationTC):
     """ Unit tests for computed relations and attributes