web/test/unittest_facet.py
branchstable
changeset 6340 470d8e828fda
parent 6338 b520b86113e3
child 6380 63d5dbaef999
child 6433 95c40961df21
--- a/web/test/unittest_facet.py	Fri Sep 24 18:20:57 2010 +0200
+++ b/web/test/unittest_facet.py	Fri Sep 24 18:20:59 2010 +0200
@@ -9,9 +9,9 @@
         rqlst = rset.syntax_tree().copy()
         req.vreg.rqlhelper.annotate(rqlst)
         mainvar, baserql = facet.prepare_facets_rqlst(rqlst, rset.args)
-        self.assertEquals(mainvar.name, 'X')
-        self.assertEquals(baserql, 'Any X WHERE X is CWUser')
-        self.assertEquals(rqlst.as_string(), 'DISTINCT Any  WHERE X is CWUser')
+        self.assertEqual(mainvar.name, 'X')
+        self.assertEqual(baserql, 'Any X WHERE X is CWUser')
+        self.assertEqual(rqlst.as_string(), 'DISTINCT Any  WHERE X is CWUser')
         return req, rset, rqlst, mainvar
 
     def test_relation_simple(self):
@@ -24,20 +24,20 @@
         f.target_attr = 'name'
         guests, managers = [eid for eid, in self.execute('CWGroup G ORDERBY GN '
                                                          'WHERE G name GN, G name IN ("guests", "managers")')]
-        self.assertEquals(f.vocabulary(),
+        self.assertEqual(f.vocabulary(),
                           [(u'guests', guests), (u'managers', managers)])
         # ensure rqlst is left unmodified
-        self.assertEquals(rqlst.as_string(), 'DISTINCT Any  WHERE X is CWUser')
+        self.assertEqual(rqlst.as_string(), 'DISTINCT Any  WHERE X is CWUser')
         #rqlst = rset.syntax_tree()
-        self.assertEquals(f.possible_values(),
+        self.assertEqual(f.possible_values(),
                           [str(guests), str(managers)])
         # ensure rqlst is left unmodified
-        self.assertEquals(rqlst.as_string(), 'DISTINCT Any  WHERE X is CWUser')
+        self.assertEqual(rqlst.as_string(), 'DISTINCT Any  WHERE X is CWUser')
         req.form[f.__regid__] = str(guests)
         f.add_rql_restrictions()
         # selection is cluttered because rqlst has been prepared for facet (it
         # is not in real life)
-        self.assertEquals(f.rqlst.as_string(),
+        self.assertEqual(f.rqlst.as_string(),
                           'DISTINCT Any  WHERE X is CWUser, X in_group D, D eid %s' % guests)
 
     def test_relation_optional_rel(self):
@@ -56,20 +56,20 @@
         f.target_attr = 'name'
         guests, managers = [eid for eid, in self.execute('CWGroup G ORDERBY GN '
                                                          'WHERE G name GN, G name IN ("guests", "managers")')]
-        self.assertEquals(f.vocabulary(),
+        self.assertEqual(f.vocabulary(),
                           [(u'guests', guests), (u'managers', managers)])
         # ensure rqlst is left unmodified
-        self.assertEquals(rqlst.as_string(), 'DISTINCT Any  GROUPBY X WHERE X in_group G?, G name GN, NOT G name "users"')
+        self.assertEqual(rqlst.as_string(), 'DISTINCT Any  GROUPBY X WHERE X in_group G?, G name GN, NOT G name "users"')
         #rqlst = rset.syntax_tree()
-        self.assertEquals(sorted(f.possible_values()),
+        self.assertEqual(sorted(f.possible_values()),
                           [str(guests), str(managers)])
         # ensure rqlst is left unmodified
-        self.assertEquals(rqlst.as_string(), 'DISTINCT Any  GROUPBY X WHERE X in_group G?, G name GN, NOT G name "users"')
+        self.assertEqual(rqlst.as_string(), 'DISTINCT Any  GROUPBY X WHERE X in_group G?, G name GN, NOT G name "users"')
         req.form[f.__regid__] = str(guests)
         f.add_rql_restrictions()
         # selection is cluttered because rqlst has been prepared for facet (it
         # is not in real life)
-        self.assertEquals(f.rqlst.as_string(),
+        self.assertEqual(f.rqlst.as_string(),
                           'DISTINCT Any  GROUPBY X WHERE X in_group G?, G name GN, NOT G name "users", X in_group D, D eid %s' % guests)
 
 
@@ -81,20 +81,20 @@
         f.rtype = 'in_group'
         f.role = 'subject'
         f.target_attr = 'name'
-        self.assertEquals(f.vocabulary(),
+        self.assertEqual(f.vocabulary(),
                           [(u'guests', u'guests'), (u'managers', u'managers')])
         # ensure rqlst is left unmodified
-        self.assertEquals(rqlst.as_string(), 'DISTINCT Any  WHERE X is CWUser')
+        self.assertEqual(rqlst.as_string(), 'DISTINCT Any  WHERE X is CWUser')
         #rqlst = rset.syntax_tree()
-        self.assertEquals(f.possible_values(),
+        self.assertEqual(f.possible_values(),
                           ['guests', 'managers'])
         # ensure rqlst is left unmodified
-        self.assertEquals(rqlst.as_string(), 'DISTINCT Any  WHERE X is CWUser')
+        self.assertEqual(rqlst.as_string(), 'DISTINCT Any  WHERE X is CWUser')
         req.form[f.__regid__] = 'guests'
         f.add_rql_restrictions()
         # selection is cluttered because rqlst has been prepared for facet (it
         # is not in real life)
-        self.assertEquals(f.rqlst.as_string(),
+        self.assertEqual(f.rqlst.as_string(),
                           "DISTINCT Any  WHERE X is CWUser, X in_group E, E name 'guests'")
 
 
@@ -104,18 +104,18 @@
                                  rqlst=rqlst.children[0],
                                  filtered_variable=mainvar)
         f.rtype = 'login'
-        self.assertEquals(f.vocabulary(),
+        self.assertEqual(f.vocabulary(),
                           [(u'admin', u'admin'), (u'anon', u'anon')])
         # ensure rqlst is left unmodified
-        self.assertEquals(rqlst.as_string(), 'DISTINCT Any  WHERE X is CWUser')
+        self.assertEqual(rqlst.as_string(), 'DISTINCT Any  WHERE X is CWUser')
         #rqlst = rset.syntax_tree()
-        self.assertEquals(f.possible_values(),
+        self.assertEqual(f.possible_values(),
                           ['admin', 'anon'])
         # ensure rqlst is left unmodified
-        self.assertEquals(rqlst.as_string(), 'DISTINCT Any  WHERE X is CWUser')
+        self.assertEqual(rqlst.as_string(), 'DISTINCT Any  WHERE X is CWUser')
         req.form[f.__regid__] = 'admin'
         f.add_rql_restrictions()
         # selection is cluttered because rqlst has been prepared for facet (it
         # is not in real life)
-        self.assertEquals(f.rqlst.as_string(),
+        self.assertEqual(f.rqlst.as_string(),
                           "DISTINCT Any  WHERE X is CWUser, X login 'admin'")