def test_do_successful_login(self): # create a fake user for testing purposes TSUser.createTSUser( username='******', email='*****@*****.**', password='******', address='RIT', name='the tester', zipcode='14623' ) # finally, attempt a login! response = self.client.post('/toolshare/login', {'username':'******', 'password':'******'}) self.assertRedirects(response, '/toolshare/zone')
def test_do_fail_login(self): # create a fake user for testing purposes TSUser.createTSUser( username='******', email='*****@*****.**', password='******', address='RIT', name='the tester', zipcode='14623' ) response = self.client.post('/toolshare/login', {'username':'******', 'password':'******'}) self.assertEqual(response.status_code, 200) self.assertContains(response, 'invalid password')