Fix: Se agrega contenido a peticion POST
This commit is contained in:
@@ -54,6 +54,29 @@ class DonConfiaoApiRouteTestCase(
|
||||
self.assertEqual(response.status_code, HTTPStatus.OK)
|
||||
self.assertEqual(len(parties), 1)
|
||||
|
||||
def test_post_parties(self):
|
||||
client = self.client()
|
||||
response = client.post(
|
||||
f'/{self.db_name}/sale_don_confiao/parties',
|
||||
headers={
|
||||
'Authorization': f'bearer {self.key}',
|
||||
}, data=json.dumps({
|
||||
"name": "Alejandro",
|
||||
}))
|
||||
|
||||
self.assertEqual(response.status_code, HTTPStatus.OK)
|
||||
|
||||
response = client.get(
|
||||
f'/{self.db_name}/sale_don_confiao/parties',
|
||||
headers={
|
||||
'Authorization': f'bearer {self.key}',
|
||||
})
|
||||
parties = json.loads(
|
||||
response.get_data().decode())
|
||||
|
||||
self.assertEqual(response.status_code, HTTPStatus.OK)
|
||||
self.assertEqual(len(parties), 2)
|
||||
|
||||
def test_get_products(self):
|
||||
pool = Pool(DB_NAME)
|
||||
transaction = Transaction().start(DB_NAME, 0, _lock_tables=[
|
||||
|
||||
Reference in New Issue
Block a user