web/test/unittest_views_apacherewrite.py
changeset 2000 bcb9a55a89e0
parent 1977 606923dff11b
child 2172 cf8f9180e63e
--- a/web/test/unittest_views_apacherewrite.py	Fri May 29 10:49:01 2009 +0200
+++ b/web/test/unittest_views_apacherewrite.py	Fri May 29 12:04:23 2009 +0200
@@ -23,22 +23,23 @@
                             rules=[('/(.*)', r'/m_%(cat)s/\1')]),
                 ]
         urlrewriter = MyAppRules()
+        req = None # not used in the above rules, so keep a simple TestCase here
         try:
-            urlrewriter.rewrite('logilab.fr', '/whatever')
+            urlrewriter.rewrite('logilab.fr', '/whatever', req)
             self.fail('redirect exception expected')
         except Redirect, ex:
             self.assertEquals(ex.location, 'http://www.logilab.fr/whatever')
-        self.assertEquals(urlrewriter.rewrite('www.logilab.fr', '/whatever'),
+        self.assertEquals(urlrewriter.rewrite('www.logilab.fr', '/whatever', req),
                           '/whatever')
-        self.assertEquals(urlrewriter.rewrite('www.logilab.fr', '/json/bla'),
+        self.assertEquals(urlrewriter.rewrite('www.logilab.fr', '/json/bla', req),
                           '/json/bla')
-        self.assertEquals(urlrewriter.rewrite('abcd.logilab.fr', '/json/bla'),
+        self.assertEquals(urlrewriter.rewrite('abcd.logilab.fr', '/json/bla', req),
                           '/json/bla')
-        self.assertEquals(urlrewriter.rewrite('abcd.logilab.fr', '/data/bla'),
+        self.assertEquals(urlrewriter.rewrite('abcd.logilab.fr', '/data/bla', req),
                           '/data/bla')
-        self.assertEquals(urlrewriter.rewrite('abcd.logilab.fr', '/whatever'),
+        self.assertEquals(urlrewriter.rewrite('abcd.logilab.fr', '/whatever', req),
                           '/m_abcd/whatever')
-        self.assertEquals(urlrewriter.rewrite('abcd.fr', '/whatever'),
+        self.assertEquals(urlrewriter.rewrite('abcd.fr', '/whatever', req),
                           '/whatever')