Skip to content

Commit

Permalink
Add id to party dummies
Browse files Browse the repository at this point in the history
  • Loading branch information
martinszy committed Aug 9, 2024
1 parent 8a82f97 commit 80ea81d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,27 +787,31 @@ def send_data(base_url, endpoint, dataset):
oi = i;
i = 900000+i
dummy_data["person_id"] = i
if endpoint == "party":
oi = i;
i = 900000+i
dummy_data["party_id"] = i
r = requests.post(full_url, json=dummy_data, headers=HEADERS)
post_status = r.status_code
if post_status != 201:
print(f"#{i} POST: {post_status} CREATE: {post_status}")
print("i",i)
print("created dummy",r.json());
print("created dummy 1",r.json());
print("row",row)
r2 = requests.delete(f"{full_url}{i}", headers=HEADERS)
delete_status = r2.status_code
if delete_status != 200:
print(f"#{i} POST: {post_status} DELETE: {delete_status}")
print("i",i)
print("created dummy",r.json());
print("can't delete dummy, reason:",r.json());
print("row",row)
if endpoint == "person":
print(f"#{i} POST: {post_status} DELETE: {delete_status}")
print("i",i)
print("created dummy",r.json());
print("created dummy 3",r.json());
print("row",row)
deleted.append(row)
if endpoint == "person":
if endpoint == "person" or endpoint == "party":
i = oi
continue
else:
Expand Down

0 comments on commit 80ea81d

Please sign in to comment.