-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add_assertion: don't assume a random user if not given
Fixes: #68 Signed-off-by: Aurélien Bompard <[email protected]>
- Loading branch information
Showing
2 changed files
with
23 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
import pytest | ||
|
||
|
||
def test_add_badges(api): | ||
issuer_id = api.add_issuer("TestOrigin", "TestName", "TestOrg", "TestContact") | ||
api.add_badge( | ||
|
@@ -76,9 +79,25 @@ def test_add_invitation(api): | |
"TestCriteria", | ||
issuer_id, | ||
) | ||
_id = api.add_invitation(badge_id) | ||
_id = api.add_invitation(badge_id, created_by_email="[email protected]") | ||
|
||
assert api.invitation_exists(_id) | ||
invitation = api.get_invitation(_id) | ||
assert api.get_person(id=invitation.created_by).email == "[email protected]" | ||
|
||
|
||
def test_add_invitation_no_created_by(api): | ||
issuer_id = api.add_issuer("TestOrigin", "TestName", "TestOrg", "TestContact") | ||
api.add_person("[email protected]") | ||
badge_id = api.add_badge( | ||
"TestBadge", | ||
"TestImage", | ||
"A test badge for doing unit tests", | ||
"TestCriteria", | ||
issuer_id, | ||
) | ||
with pytest.raises(ValueError): | ||
api.add_invitation(badge_id) | ||
|
||
|
||
def test_last_login(api, callback_calls): | ||
|