-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add editing of meal donations. (#126)
Co-authored-by: Shahan Neda <[email protected]>
- Loading branch information
Showing
16 changed files
with
783 additions
and
1,445 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,25 +89,34 @@ def meal_request_setup(user_setup): | |
def onsite_contact_setup(user_setup): | ||
asp, donor, _ = user_setup | ||
asp_onsite_contact = OnsiteContact( | ||
name="Sample Contact", | ||
name="Sample ASP Contact", | ||
email="[email protected]", | ||
phone="123-456-7890", | ||
organization_id=asp.id, | ||
).save() | ||
asp_onsite_contact2 = OnsiteContact( | ||
name="Sample Contact 2", | ||
name="Sample ASP Contact 2", | ||
email="[email protected]", | ||
phone="123-456-7890", | ||
organization_id=asp.id, | ||
).save() | ||
donor_onsite_contact = OnsiteContact( | ||
name="Sample Contact 2", | ||
name="Sample Donor Contact 1", | ||
email="[email protected]", | ||
phone="123-333-7890", | ||
organization_id=donor.id, | ||
).save() | ||
donor_onsite_contact2 = OnsiteContact( | ||
name="Sample Donor 2", | ||
email="[email protected]", | ||
phone="123-333-7890", | ||
organization_id=donor.id, | ||
).save() | ||
|
||
yield asp, donor, [asp_onsite_contact, asp_onsite_contact2], donor_onsite_contact | ||
yield asp, donor, [asp_onsite_contact, asp_onsite_contact2], [ | ||
donor_onsite_contact, | ||
donor_onsite_contact2, | ||
] | ||
asp_onsite_contact.delete() | ||
donor_onsite_contact.delete() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,13 +54,13 @@ def test_create_onsite_contact(onsite_contact_setup): | |
|
||
|
||
def test_update_onsite_contact(onsite_contact_setup): | ||
asp, donor, asp_onsite_contacts, donor_onsite_contact = onsite_contact_setup | ||
asp, donor, asp_onsite_contacts, donor_onsite_contacts = onsite_contact_setup | ||
|
||
# Test for the update mutation | ||
mutation = f""" | ||
mutation u{{ | ||
updateOnsiteContact( | ||
id: "{donor_onsite_contact.id}", | ||
id: "{donor_onsite_contacts[0].id}", | ||
name: "Updated Bob Cat", | ||
email: "[email protected]", | ||
phone: "604-433-2222", | ||
|
@@ -78,7 +78,7 @@ def test_update_onsite_contact(onsite_contact_setup): | |
result = graphql_schema.execute(mutation) | ||
assert result.errors is None | ||
updated_result_contact = result.data["updateOnsiteContact"]["onsiteContact"] | ||
updated_db_result = OnsiteContact.objects(id=donor_onsite_contact["id"]).first() | ||
updated_db_result = OnsiteContact.objects(id=donor_onsite_contacts[0]["id"]).first() | ||
|
||
for contact in [updated_result_contact, updated_db_result]: | ||
assert contact["name"] == "Updated Bob Cat" | ||
|
Oops, something went wrong.