예제 #1
0
 def test_user_pw(self):
     res = self.client.post('/api/v1/user/add',
                            data=dict(email='*****@*****.**',
                                      username='******',
                                      password='******'))
     user = AppUser.get_by_id(json.loads(res.get_data()).get('id'))
     self.assertTrue(user.check_password('xxxx'))
예제 #2
0
 def test_user_pw_fail(self):
     res = self.client.post('/api/v1/user/add',
                            data=dict(email='*****@*****.**',
                                      username='******',
                                      password='******'))
     print json.loads(res.get_data()).get('id')
     id = json.loads(res.get_data()).get('id')
     user = AppUser.get_by_id(id)
     self.assertFalse(user.check_password('xsssxxx'))
 def test_user_pw(self):
     res = self.client.post('/api/v1/user/add',data=dict(email='*****@*****.**',username='******',password='******'))
     user = AppUser.get_by_id(json.loads(res.get_data()).get('id'))
     self.assertTrue(user.check_password('xxxx'))
 def test_user_pw_fail(self):
     res = self.client.post('/api/v1/user/add',data=dict(email='*****@*****.**',username='******',password='******'))
     print json.loads(res.get_data()).get('id')
     id = json.loads(res.get_data()).get('id')
     user = AppUser.get_by_id(id)
     self.assertFalse(user.check_password('xsssxxx'))
예제 #5
0
 def test_user_pw_fail(self):
     res = self.client.post('/api/v1/user/add',data=dict(email='*****@*****.**',username='******',password='******'))
     user = AppUser.get_by_id(2)
     self.assertFalse(user.check_password('xsssxxx'))