Ejemplo n.º 1
0
    def test_does_not_create_wallet_with_non_existing_user(self, database):
        user = User(id=uuid.uuid4(),
                    first_name=self.first_name,
                    last_name=self.last_name,
                    email=self.email)

        prev_count = Wallet.query.count()

        with pytest.raises(InvalidUser):
            wallet = Wallet.create(user, self.currency)

        assert Wallet.query.count() == prev_count
Ejemplo n.º 2
0
    def test_does_not_create_user_authentication_details_with_non_existing_user(
            self, database):
        user = User(id=uuid.uuid4(),
                    first_name=self.first_name,
                    last_name=self.last_name,
                    email=self.email)

        prev_count = UserAuthenticationDetail.query.count()

        with pytest.raises(InvalidUserAuthenticationDetails):
            user_authentication_detail = UserAuthenticationDetail.create(
                user=user, email=self.email, password=self.password)

        assert UserAuthenticationDetail.query.count() == prev_count