Ejemplo n.º 1
0
 def testRemoveUser(self):
     """
     test delete method in models
     """
     response = BeatMyGoalUser.create('test_user_view','test_email_view','test_password_view')
     test_user = response['user']
     test_user_userid = test_user.id
     response1 = BeatMyGoalUser.remove(test_user_userid)
     self.assertTrue(not response1['errors'])
     response2 = BeatMyGoalUser.getUserById(test_user_userid)
     self.assertTrue(response2['errors'])
Ejemplo n.º 2
0
 def testGetUserbyId(self):
     """
     test getUserById method in models
     """
     responce = BeatMyGoalUser.create('test_user_view','test_email_view','test_password_view')
     test_user = responce['user']
     test_user_userid = test_user.id
     test_user_username = test_user.username
     test_user_email = test_user.email
     response = BeatMyGoalUser.getUserById(test_user_userid)
     self.assertTrue(not response['errors'])
     user = response['user']
     self.assertEqual(test_user_userid,user.id)
     self.assertEqual(test_user_username,user.username)
     self.assertEqual(test_user_email,user.email)
Ejemplo n.º 3
0
 def testGetUserbyIdWrong(self):
     """
     test getUserByName method in models
     """
     response = BeatMyGoalUser.getUserById(-99)
     self.assertTrue(response['errors'])