示例#1
0
 def test_when_existing_user_exists(self):
     self.mock_post.return_value = self.mock_response(
         {
             'message': "Client already exist.",
             'status': 'error'
         },
         overwrite=True)
     base = Client(auth_key=config.demo_auth_key)
     code, status, message = base.add(
         email=config.test_user["email"],
         first_name=config.test_user["first_name"],
         last_name=config.test_user["last_name"],
         phone=config.test_user["phone"])
     self.assertEqual(code, 200)
     self.assertEqual(status, 'error')
     self.assertEqual(message, "Client already exist.")
示例#2
0
    def test_add_new_client_successfully(self):
        self.mock_post.return_value = self.mock_response(
            {
                'message': "Client created successfully.",
                "status": "success",
                "data": config.test_user
            },
            overwrite=True)

        base = Client(auth_key=config.demo_auth_key)
        code, status, client = base.add(
            email=config.test_user["email"],
            first_name=config.test_user["first_name"],
            last_name=config.test_user["last_name"],
            phone=config.test_user["phone"])
        self.assertEquals(client, config.test_user)
        self.assertEqual(code, 200),
        self.assertEqual(status, 'success')
示例#3
0
 def test_add_new_client_successfully1(self):
     base = Client(auth_key=config.demo_auth_key)
     datas = base.add(email=config.test_user["email"],
                      first_name=config.test_user["first_name"],
                      last_name=config.test_user["last_name"],
                      phone=config.test_user["phone"])
示例#4
0
 def test_get(self):
     base = Client(auth_key=config.demo_auth_key)