def test_login_success(self): page = LoginPage(self.client) page.login('user001', 'wombat', '/') response = page.response self.assertEqual(response.status_code, 302, "User login probably failed.") self.assertEqual(response['Location'], 'http://testserver/')
def test_login_success(self): page = LoginPage(self.client) page.login('user001', 'wombat', '/') response = page.response self.assertEqual(response.status_code, 302, "User login probably failed." ) self.assertEqual(response['Location'], 'http://testserver/')
def test_login_failure(self): page = LoginPage(self.client) page.login('missinguser', 'badpass') response = page.response self.assertEqual(response.status_code, 200) self.assertTrue( re.search( r"(Username and password didn't match. Please try again.)", response.content), "A Failed login did not return the right message.")
def test_login_failure(self): page = LoginPage(self.client) page.login('missinguser', 'badpass') response = page.response self.assertEqual(response.status_code, 200) self.assertTrue(re.search( r"(Username and password didn't match. Please try again.)", response.content ), "A Failed login did not return the right message.")
def setUp(self): page = LoginPage(self.client) page.login('user001', 'wombat')
def test_login_present(self): page = LoginPage(self.client) page.visit() self.failUnlessEqual(page.response.status_code, 200)