diff -r 58668fc33ea9 tests/regressiontests/templates/tests.py
a
|
b
|
|
364 | 364 | settings.TEMPLATE_STRING_IF_INVALID = invalid_str |
365 | 365 | for is_cached in (False, True): |
366 | 366 | try: |
| 367 | start = datetime.now() |
367 | 368 | test_template = loader.get_template(name) |
| 369 | end = datetime.now() |
368 | 370 | output = self.render(test_template, vals) |
| 371 | if end-start > timedelta(seconds=0.1): |
| 372 | failures.append("Template test (Cached='%s', TEMPLATE_STRING_IF_INVALID='%s'): %s -- FAILED. Took too long to parse test" % (is_cached, invalid_str, name)) |
369 | 373 | except ContextStackException: |
370 | 374 | failures.append("Template test (Cached='%s', TEMPLATE_STRING_IF_INVALID='%s'): %s -- FAILED. Context stack was left imbalanced" % (is_cached, invalid_str, name)) |
371 | 375 | continue |
… |
… |
|
1175 | 1179 | # Successes |
1176 | 1180 | 'legacyurl02': ('{% url regressiontests.templates.views.client_action id=client.id,action="update" %}', {'client': {'id': 1}}, '/url_tag/client/1/update/'), |
1177 | 1181 | 'legacyurl02a': ('{% url regressiontests.templates.views.client_action client.id,"update" %}', {'client': {'id': 1}}, '/url_tag/client/1/update/'), |
| 1182 | 'legacyurl02b': ("{% url regressiontests.templates.views.client_action id=client.id,action='update' %}", {'client': {'id': 1}}, '/url_tag/client/1/update/'), |
| 1183 | 'legacyurl02c': ("{% url regressiontests.templates.views.client_action client.id,'update' %}", {'client': {'id': 1}}, '/url_tag/client/1/update/'), |
1178 | 1184 | 'legacyurl10': ('{% url regressiontests.templates.views.client_action id=client.id,action="two words" %}', {'client': {'id': 1}}, '/url_tag/client/1/two%20words/'), |
1179 | 1185 | 'legacyurl13': ('{% url regressiontests.templates.views.client_action id=client.id, action=arg|join:"-" %}', {'client': {'id': 1}, 'arg':['a','b']}, '/url_tag/client/1/a-b/'), |
1180 | 1186 | 'legacyurl14': ('{% url regressiontests.templates.views.client_action client.id, arg|join:"-" %}', {'client': {'id': 1}, 'arg':['a','b']}, '/url_tag/client/1/a-b/'), |
| 1187 | 'legacyurl16': ('{% url regressiontests.templates.views.client_action action="update",id="1" %}', {}, '/url_tag/client/1/update/'), |
| 1188 | 'legacyurl16a': ("{% url regressiontests.templates.views.client_action action='update',id='1' %}", {}, '/url_tag/client/1/update/'), |
| 1189 | 'legacyurl17': ('{% url regressiontests.templates.views.client_action client_id=client.my_id,action=action %}', {'client': {'my_id': 1}, 'action': 'update'}, '/url_tag/client/1/update/'), |
1181 | 1190 | |
1182 | 1191 | 'url01': ('{% url regressiontests.templates.views.client client.id %}', {'client': {'id': 1}}, '/url_tag/client/1/'), |
1183 | 1192 | 'url02': ('{% url regressiontests.templates.views.client_action id=client.id action="update" %}', {'client': {'id': 1}}, '/url_tag/client/1/update/'), |
1184 | 1193 | 'url02a': ('{% url regressiontests.templates.views.client_action client.id "update" %}', {'client': {'id': 1}}, '/url_tag/client/1/update/'), |
| 1194 | 'url02b': ("{% url regressiontests.templates.views.client_action id=client.id action='update' %}", {'client': {'id': 1}}, '/url_tag/client/1/update/'), |
| 1195 | 'url02c': ("{% url regressiontests.templates.views.client_action client.id 'update' %}", {'client': {'id': 1}}, '/url_tag/client/1/update/'), |
1185 | 1196 | 'url03': ('{% url regressiontests.templates.views.index %}', {}, '/url_tag/'), |
1186 | 1197 | 'url04': ('{% url named.client client.id %}', {'client': {'id': 1}}, '/url_tag/named-client/1/'), |
1187 | 1198 | 'url05': (u'{% url метка_оператора v %}', {'v': u'Ω'}, '/url_tag/%D0%AE%D0%BD%D0%B8%D0%BA%D0%BE%D0%B4/%CE%A9/'), |
diff -r 58668fc33ea9 tests/regressiontests/templates/urls.py
a
|
b
|
|
8 | 8 | (r'^$', views.index), |
9 | 9 | (r'^client/(\d+)/$', views.client), |
10 | 10 | (r'^client/(?P<id>\d+)/(?P<action>[^/]+)/$', views.client_action), |
| 11 | (r'^client/(?P<client_id>\d+)/(?P<action>[^/]+)/$', views.client_action), |
11 | 12 | url(r'^named-client/(\d+)/$', views.client2, name="named.client"), |
12 | 13 | |
13 | 14 | # Unicode strings are permitted everywhere. |