cubicweb/test/unittest_rset.py
changeset 11870 3a84a79c4ed5
parent 11171 b81e543e623a
child 11874 ea1d92b677b5
--- a/cubicweb/test/unittest_rset.py	Thu Nov 24 16:58:27 2016 +0100
+++ b/cubicweb/test/unittest_rset.py	Thu Nov 24 16:58:50 2016 +0100
@@ -1,5 +1,5 @@
 # coding: utf-8
-# copyright 2003-2014 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
+# copyright 2003-2016 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
 #
 # This file is part of CubicWeb.
@@ -44,12 +44,12 @@
     def test_relations_description(self):
         """tests relations_description() function"""
         queries = {
-            'Any U,L,M where U is CWUser, U login L, U mail M' : [(1, 'login', 'subject'), (2, 'mail', 'subject')],
-            'Any U,L,M where U is CWUser, L is Foo, U mail M' : [(2, 'mail', 'subject')],
-            'Any C,P where C is Company, C employs P' : [(1, 'employs', 'subject')],
-            'Any C,P where C is Company, P employed_by P' : [],
-            'Any C where C is Company, C employs P' : [],
-            }
+            'Any U,L,M where U is CWUser, U login L, U mail M': [(1, 'login', 'subject'), (2, 'mail', 'subject')],
+            'Any U,L,M where U is CWUser, L is Foo, U mail M': [(2, 'mail', 'subject')],
+            'Any C,P where C is Company, C employs P': [(1, 'employs', 'subject')],
+            'Any C,P where C is Company, P employed_by P': [],
+            'Any C where C is Company, C employs P': [],
+        }
         for rql, relations in queries.items():
             result = list(attr_desc_iterator(parse(rql).children[0], 0, 0))
             self.assertEqual((rql, result), (rql, relations))
@@ -57,9 +57,10 @@
     def test_relations_description_indexed(self):
         """tests relations_description() function"""
         queries = {
-            'Any C,U,P,L,M where C is Company, C employs P, U is CWUser, U login L, U mail M' :
-            {0: [(2,'employs', 'subject')], 1: [(3,'login', 'subject'), (4,'mail', 'subject')]},
-            }
+            'Any C,U,P,L,M where C is Company, C employs P, U is CWUser, U login L, U mail M':
+            {0: [(2, 'employs', 'subject')],
+             1: [(3, 'login', 'subject'), (4, 'mail', 'subject')]},
+        }
         for rql, results in queries.items():
             for idx, relations in results.items():
                 result = list(attr_desc_iterator(parse(rql).children[0], idx, idx))
@@ -284,7 +285,7 @@
     def test_get_entity_simple(self):
         with self.admin_access.web_request() as req:
             req.create_entity('CWUser', login=u'adim', upassword='adim',
-                                         surname=u'di mascio', firstname=u'adrien')
+                              surname=u'di mascio', firstname=u'adrien')
             req.drop_entity_cache()
             e = req.execute('Any X,T WHERE X login "adim", X surname T').get_entity(0, 0)
             self.assertEqual(e.cw_attr_cache['surname'], 'di mascio')