def test_create(self): with requests_mock.mock() as mock: mock.post(client.get_full_url('data/persons'), text='{"id": "person-1", "first_name": "John"}') self.assertEquals(client.create('persons', {"first_name": "John"}), { "id": "person-1", "first_name": "John" })
def test_create(self): with requests_mock.mock() as mock: mock.post( raw.get_full_url("data/persons"), text=json.dumps({"id": "person-01", "first_name": "John"}), ) self.assertEqual( raw.create("persons", {"first_name": "John"}), {"id": "person-01", "first_name": "John"}, )
def test_create(self): with requests_mock.mock() as mock: mock.post( client.get_full_url("data/persons"), text='{"id": "person-01", "first_name": "John"}', ) self.assertEqual( client.create("persons", {"first_name": "John"}), { "id": "person-01", "first_name": "John" }, )