예제 #1
0
    def test_validate_email_already_registered(self, user):
        # enters email that is already registered
        form = RegisterForm(username='******', email=user.email,
            password='******', confirm='example')

        assert form.validate() is False
        assert 'Email already registered' in form.email.errors
예제 #2
0
    def test_validate_user_already_registered(self, user):
        # Enters username that is already registered
        form = RegisterForm(username=user.username, email='*****@*****.**',
            password='******', confirm='example')

        assert form.validate() is False
        assert 'Username already registered' in form.username.errors
예제 #3
0
    def test_validate_user_already_registered(self, user):
        # Enters username that is already registered
        form = RegisterForm(username=user.username, email="*****@*****.**", password="******", confirm="example")

        assert form.validate() is False
        assert "Username already registered" in form.username.errors
예제 #4
0
 def test_validate_success(self, db):
     form = RegisterForm(username="******", email="*****@*****.**", password="******", confirm="example")
     assert form.validate() is True
예제 #5
0
    def test_validate_email_already_registered(self, user):
        # enters email that is already registered
        form = RegisterForm(username="******", email=user.email, password="******", confirm="example")

        assert form.validate() is False
        assert "Email already registered" in form.email.errors
예제 #6
0
 def test_validate_success(self, db):
     form = RegisterForm(username='******', email='*****@*****.**',
         password='******', confirm='example')
     assert form.validate() is True