# -*- coding: utf-8 -*-

from __future__ import absolute_import


from ..testcases import SeleniumLiveTestCase


class NavigationTestCase(SeleniumLiveTestCase):

    test_templates = [
        (r'^nav_1/$', 'nav_1.html'),
        (r'^nav_1/nav_2/$', 'nav_2.html')
    ]

    def test_get_page(self):
        """ Test that you can traverse the page tree. """
        self.get_page("/nav_1/")
        self.should_see("This is nav 1.")
        self.get_page("/nav_1/nav_2/")
        self.should_see("This is nav 2.")

@@ -380,24 +380,96 @@
 (%22/nav_1/%22)%0A
+        self.has_title(%22Navigation 1%22)%0A        self.title_contains(%221%22)%0A
         self
@@ -575,12 +575,706 @@
 is nav 2.%22)%0A
+%0A    def test_get_bad_page(self):%0A        %22%22%22 Test that /bogus/ is not found. %22%22%22%0A        self.get_page(%22/bogus/%22)%0A        self.should_see(%22Not Found%22)%0A        self.should_see(%0A            %22The requested URL /bogus/ was not found on this server.%22)%0A%0A    def test_missing_content_with_retry(self):%0A        %22%22%22 Test retry for missing content, LONG RETRIES! %22%22%22%0A        self.get_page(%22/nav_1/%22)%0A        self.should_not_see(%22This is nav 2.%22)%0A        self.url_should_not_contain(%22nav_2%22)%0A        self.has_not_title(%22Navigation 2%22)%0A        self.title_does_not_contain(%222%22)%0A        self.assertRaises(%0A            AssertionError, self.click_button, %22not_there_dude%22)%0A        self.not_at_page(%22/nav_2/%22)%0A

Test missing content and failed navigation tests.