def test_register_route_user_created_successfully(self): """ test to ensure that a user was created successfuly""" newuser, newuserpassword = "******", "password_hehe" data = { "username": newuser, "password": newuserpassword, "confirm_password": newuserpassword } response = self.client.post(self.register_url, data=data, follow_redirects=True) # check if there are 2 users in the db, the user and setup and the new user created self.assertEqual(2, len(User.objects())) self.assertEqual(200, response.status_code)
def test_user_object_exists(self): """ test that a user instannce was created well in the db""" self.assertIsInstance(self.uche, User) self.assertIsNotNone(User.objects(username=self.uche.username).first())