Skip to content
This repository
Browse code

Test relative url_for

  • Loading branch information...
commit 1301c36c3b658e557888f7f2cc1dcc897bbafd06 1 parent e54f24c
Simon Sapin authored August 13, 2012

Showing 1 changed file with 12 additions and 2 deletions. Show diff stats Hide diff stats

  1. 14  flask_frozen/tests.py
14  flask_frozen/tests.py
@@ -356,8 +356,8 @@ class TestBaseURL(TestFreezer):
356 356
     expected_output['/'] = 'Main index /myapp/product_5/?revision=b12ef20'
357 357
     expected_output['/where_am_i/'] = \
358 358
         '/myapp/where_am_i/ http://example/myapp/where_am_i/'
359  
-    expected_output['/admin/'] = expected_output['/admin/'].replace(
360  
-        'href="/page', 'href="/myapp/page')
  359
+    expected_output['/admin/'] = ('Admin index\n'
  360
+        '<a href="/myapp/page/I%20l%C3%B8v%C3%AB%20Unicode/">Unicode test</a>')
361 361
 
362 362
     def do_extra_config(self, app, freezer):
363 363
         app.config['FREEZER_BASE_URL'] = 'http://example/myapp/'
@@ -380,6 +380,16 @@ class TestWithoutUrlForLog(TestFreezer):
380 380
         del expected_output[url]
381 381
         del filenames[url]
382 382
 
  383
+
  384
+class TestRelativeUrlFor(TestFreezer):
  385
+    def do_extra_config(self, app, freezer):
  386
+        app.config['FREEZER_RELATIVE_URLS'] = True
  387
+
  388
+    expected_output = TestFreezer.expected_output.copy()
  389
+    expected_output['/admin/'] = ('Admin index\n<a href="'
  390
+        '../page/I%20l%C3%B8v%C3%AB%20Unicode/index.html">Unicode test</a>')
  391
+
  392
+
383 393
 # with_no_argument_rules=False and with_static_files=False are
384 394
 # not tested as they produces (expected!) warnings
385 395
 

0 notes on commit 1301c36

Please sign in to comment.
Something went wrong with that request. Please try again.