[test] Import testutils as a whole
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 02 Nov 2017 20:41:10 +0100
changeset 2825 97404ac46824
parent 2824 9d9a6b34e029
child 2826 54a83326c9a5
[test] Import testutils as a whole
test/test_diag.py
--- a/test/test_diag.py	Thu Nov 02 20:39:10 2017 +0100
+++ b/test/test_diag.py	Thu Nov 02 20:41:10 2017 +0100
@@ -1,4 +1,4 @@
-# copyright 2016-2017 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 # contact http://www.logilab.fr -- mailto:contact@logilab.fr
 #
 # This program is free software: you can redistribute it and/or modify it under
@@ -17,7 +17,7 @@
 
 from cubicweb.devtools.testlib import CubicWebTC
 
-from cubicweb_seda.testutils import create_archive_unit
+from cubicweb_seda import testutils
 
 
 class CompatAnalyzerTC(CubicWebTC):
@@ -31,7 +31,7 @@
             cnx.commit()
             self.assertDiagnostic(doctor, ['SEDA 2.0', 'SEDA 1.0', 'SEDA 0.2', 'simplified'])
 
-            unit, unit_alt, unit_alt_seq = create_archive_unit(transfer)
+            unit, unit_alt, unit_alt_seq = testutils.create_archive_unit(transfer)
             transfer.cw_clear_all_caches()
             cnx.commit()
             self.assertDiagnostic(doctor, ['SEDA 2.0', 'SEDA 0.2', 'simplified'],
@@ -83,7 +83,7 @@
             create = cnx.create_entity
 
             transfer = create('SEDAArchiveTransfer', title=u'diagnosis testing')
-            unit, unit_alt, unit_alt_seq = create_archive_unit(transfer)
+            unit, unit_alt, unit_alt_seq = testutils.create_archive_unit(transfer)
             access_rule = create('SEDAAccessRule',
                                  seda_access_rule=unit_alt_seq)
             access_rule_seq = create('SEDASeqAccessRuleRule',
@@ -117,7 +117,7 @@
     def test_archive_unit_reference_in_transfer(self):
         with self.admin_access.cnx() as cnx:
             transfer = cnx.create_entity('SEDAArchiveTransfer', title=u'diagnosis testing')
-            create_archive_unit(transfer, archive_unit_reference=True)
+            testutils.create_archive_unit(transfer, archive_unit_reference=True)
 
             doctor = transfer.cw_adapt_to('ISEDACompatAnalyzer')
             cnx.commit()
@@ -126,8 +126,8 @@
     def test_archive_unit_reference_in_archive_unit(self):
         with self.admin_access.cnx() as cnx:
             transfer = cnx.create_entity('SEDAArchiveTransfer', title=u'diagnosis testing')
-            unit, unit_alt, unit_alt_seq = create_archive_unit(transfer)
-            create_archive_unit(unit_alt_seq, archive_unit_reference=True)
+            unit, unit_alt, unit_alt_seq = testutils.create_archive_unit(transfer)
+            testutils.create_archive_unit(unit_alt_seq, archive_unit_reference=True)
 
             doctor = transfer.cw_adapt_to('ISEDACompatAnalyzer')
             cnx.commit()