286 |
286 |
resp = resp.form.submit()
|
287 |
287 |
assert 'syntax error:' in resp.text
|
288 |
288 |
resp = resp.click('Cancel')
|
289 |
|
# exclude from nav
|
290 |
|
page2 = Page.objects.create(title='Two', parent=Page.objects.get(), exclude_from_navigation=False)
|
291 |
|
resp = resp.click(href='.*/include-in-navigation')
|
292 |
|
resp.form['include_in_navigation'].checked = False
|
293 |
|
resp = resp.form.submit()
|
294 |
|
resp = resp.follow()
|
295 |
|
assert Page.objects.all()[0].exclude_from_navigation is True
|
296 |
|
assert Page.objects.get(pk=page2.pk).exclude_from_navigation is False
|
297 |
289 |
# include from nav
|
|
290 |
page2 = Page.objects.create(title='Two', parent=Page.objects.get(), exclude_from_navigation=True)
|
298 |
291 |
resp = resp.click(href='.*/include-in-navigation')
|
299 |
292 |
resp.form['include_in_navigation'].checked = True
|
300 |
293 |
resp = resp.form.submit()
|
301 |
294 |
resp = resp.follow()
|
302 |
295 |
assert Page.objects.all()[0].exclude_from_navigation is False
|
303 |
|
# exclude from nav including subpages
|
|
296 |
assert Page.objects.get(pk=page2.pk).exclude_from_navigation is True
|
|
297 |
# exclude from nav
|
304 |
298 |
resp = resp.click(href='.*/include-in-navigation')
|
305 |
299 |
resp.form['include_in_navigation'].checked = False
|
306 |
|
resp.form['apply_to_subpages'].checked = True
|
|
300 |
assert 'apply_to_subpages' not in resp.form.fields
|
307 |
301 |
resp = resp.form.submit()
|
308 |
302 |
resp = resp.follow()
|
|
303 |
assert Page.objects.all()[0].exclude_from_navigation is True
|
309 |
304 |
assert Page.objects.get(pk=page2.pk).exclude_from_navigation is True
|
310 |
305 |
# include from nav including subpages
|
311 |
306 |
resp = resp.click(href='.*/include-in-navigation')
|
... | ... | |
313 |
308 |
resp.form['apply_to_subpages'].checked = True
|
314 |
309 |
resp = resp.form.submit()
|
315 |
310 |
resp = resp.follow()
|
|
311 |
assert Page.objects.all()[0].exclude_from_navigation is False
|
316 |
312 |
assert Page.objects.get(pk=page2.pk).exclude_from_navigation is False
|
317 |
313 |
|
318 |
314 |
|
319 |
|
-
|