Exemple #1
0
    def test_sign_up(self):
        Client().post('/', {'email': '*****@*****.**'})
        users = User.objects.all()
        self.assertEqual(len(users), 1)
        self.assertEqual(users[0].email, '*****@*****.**')

        self.visit('/')
        BROWSER.fill('email', '*****@*****.**')
        BROWSER.find_by_name('go').click()
        assert BROWSER.is_text_present('Thanks'), 'rude!'

        users = User.objects.all()
        self.assertEqual(len(users), 2)
        self.assertEqual(users[1].email, '*****@*****.**')
Exemple #2
0
 def test_invalid_emails_get_yelled_about(self):
     self.visit('/')
     BROWSER.fill('email', 'aghlaghlaghl')
     assert BROWSER.is_text_present('invalid'), "didn't get yelled at"
Exemple #3
0
 def test_valid_emails_get_validated(self):
     self.visit('/')
     BROWSER.fill('email', '*****@*****.**')
     assert BROWSER.is_text_present('valid'), "didn't get validated"