Example #1
0
    def test_csrf_delete(self):
        # First set up and test AJAX login
        self.setUpAjaxLogin()

        self.open_url("/")
        try_ajax_login(self, "student", "student")
        self.failUnless(self.is_text_present('Student Student'))
        logout(self)

        self.delete_cookie("esp_csrftoken")

        try_ajax_login(self, "student", "student")
        self.failUnless(self.is_text_present('Student Student'))
        logout(self)

        # Now set up and test normal login
        self.setUpNormalLogin()
        self.open_url("/")  # Load index

        try_normal_login(self, "student", "student")
        self.failUnless(self.is_text_present('Student Student'))
        logout(self)

        self.delete_cookie("esp_csrftoken")

        try_normal_login(self, "student", "student")
        self.failUnless(self.is_text_present('Student Student'))
        logout(self)

        self.close()
    def test_csrf_delete(self):
        # Now set up and test normal login
        self.setUpNormalLogin()
        self.open_url("/") # Load index

        try_normal_login(self, "student", "student")
        self.assertTrue(self.is_text_present('Student Student'))
        logout(self)

        self.delete_cookie("esp_csrftoken")

        try_normal_login(self, "student", "student")
        self.assertTrue(self.is_text_present('Student Student'))
        logout(self)

        self.close()
Example #3
0
    def test_csrf_delete(self):
        # Now set up and test normal login
        self.setUpNormalLogin()
        self.open_url("/")  # Load index

        try_normal_login(self, "student", "student")
        self.assertTrue(self.is_text_present('Student Student'))
        logout(self)

        self.delete_cookie("esp_csrftoken")

        try_normal_login(self, "student", "student")
        self.assertTrue(self.is_text_present('Student Student'))
        logout(self)

        self.close()
Example #4
0
    def check_page(self, page):
        self.open_url("/")
        try_normal_login(self, self.admin_user.username, self.PASSWORD_STRING)
        self.open_url(page)
        self.editQSD()

        self.delete_all_cookies()
        self.open_url(page)
        self.failUnless(self.is_text_present(self.TEST_STRING))
        logout(self)

        try_normal_login(self, self.qsd_user.username, self.PASSWORD_STRING)
        self.open_url(page)
        self.editQSD()

        self.delete_all_cookies()
        self.open_url(page)
        self.failUnless(self.is_text_present(self.TEST_STRING))
    def check_page(self, page):
        self.open_url("/")
        try_normal_login(self, self.admin_user.username, self.PASSWORD_STRING)
        self.open_url(page)
        self.editQSD()

        self.delete_all_cookies()
        self.open_url(page)
        self.assertTrue(self.is_text_present(self.TEST_STRING))
        logout(self)

        try_normal_login(self, self.qsd_user.username, self.PASSWORD_STRING)
        self.open_url(page)
        self.editQSD()

        self.delete_all_cookies()
        self.open_url(page)
        self.assertTrue(self.is_text_present(self.TEST_STRING))