def test_duplicate_user_signup(self): request = self._get_request() request.POST['username'] = '******' request.POST['password'] = '******' response = signup(request) self.assertEqual(response.status_int, 302) request = self._get_request() request.POST['username'] = '******' request.POST['password'] = '******' response = signup(request) self.assertEqual(response.status_int, 400)
def test_user_signup_and_auth(self): request = self._get_request() request.POST['username'] = '******' request.POST['password'] = '******' response = signup(request) self.assertEqual(response.status_int, 302) request = self._get_request() request.POST['username'] = '******' request.POST['password'] = '******' response = auth(request) self.assertEqual(response.status_int, 302) auth_token = request.session['authentication'] self.assertTrue(auth_token.is_authenticated())