[doc] default tests template has changed 3.26
authorLaurent Peuch <cortex@worlddomination.be>
Thu, 21 Feb 2019 15:16:22 +0100
branch3.26
changeset 12448 e3bcfd6432bc
parent 12447 247b86512d94
child 12449 3724ddd950d3
[doc] default tests template has changed
doc/tutorials/advanced/part02_security.rst
--- a/doc/tutorials/advanced/part02_security.rst	Thu Feb 21 15:13:45 2019 +0100
+++ b/doc/tutorials/advanced/part02_security.rst	Thu Feb 21 15:16:22 2019 +0100
@@ -309,10 +309,10 @@
 
 .. sourcecode:: python
 
-    from cubicweb.devtools.testlib import CubicWebTC
+    from cubicweb.devtools import testlib
     from cubicweb import Binary
 
-    class SecurityTC(CubicWebTC):
+    class SecurityTC(testlib.CubicWebTC):
 
         def test_visibility_propagation(self):
             with self.admin_access.repo_cnx() as cnx:
@@ -355,8 +355,8 @@
                 self.assertEquals(1, len(cnx.execute('Folder X'))) # and to restricted folder
 
     if __name__ == '__main__':
-        from logilab.common.testlib import unittest_main
-        unittest_main()
+        from unittest import main
+        main()
 
 It's not complete, but shows most things you'll want to do in tests: adding some
 content, creating users and connecting as them in the test, etc...