예제 #1
0
    def test_userCreate_whenValidEmailAndPass_shouldCreateUser(self):
        user = RecipesUser(
            email='*****@*****.**',
            password='******',
        )

        user.full_clean()
        user.save()

        self.assertIsNotNone(user)
예제 #2
0
    def test_userCreate_whenInvalidEmail_shouldRaiseError(self):
        user = RecipesUser(
            email='invalid',
            password='******',
        )

        try:
            user.full_clean()
            user.save()
            self.fail()
        except ValidationError as ex:
            self.assertIsNotNone(ex)