def test_register_new(self): register(self.registrant['email'], self.registrant['username'], self.registrant['password']) registrant = Registration.query.filter_by( email=self.registrant['email']).first() self.assertEquals(registrant.email, self.registrant['email']) self.assertEquals(registrant.username, self.registrant['username']) self.assertEquals(registrant.password, self.registrant['password']) self.assertTrue(registrant.key)
def test_registered_author_username(self): with self.assertRaises(ValueError): register(self.registrant['email'], 'username1', self.registrant['password'])
def test_registered_author_email(self): with self.assertRaises(ValueError): register("*****@*****.**", self.registrant['username'], self.registrant['password'])
def test_registered_registration_email(self): with self.assertRaises(ValueError): register('*****@*****.**', self.registrant['username'], self.registrant['password'])