[doc] default tests template has changed
authorLaurent Peuch <cortex@worlddomination.be>
Thu, 21 Feb 2019 15:16:22 +0100
changeset 12383 2dee7a944b3a
parent 12382 c73da3aa84cc
child 12384 b2e0b6a8f76c
[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...