Exemple #1
0
 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)
Exemple #2
0
 def test_registered_author_username(self):
     with self.assertRaises(ValueError):
         register(self.registrant['email'],
                  'username1',
                  self.registrant['password'])
Exemple #3
0
 def test_registered_author_email(self):
     with self.assertRaises(ValueError):
         register("*****@*****.**",
                  self.registrant['username'],
                  self.registrant['password'])
Exemple #4
0
 def test_registered_registration_email(self):
     with self.assertRaises(ValueError):
         register('*****@*****.**',
                  self.registrant['username'],
                  self.registrant['password'])