Skip to content

Commit

Permalink
tests: additional assertions on invitation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
azmeuk committed Nov 21, 2023
1 parent 3752693 commit e622567
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/core/test_invitation.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ def test_invitation(testclient, logged_admin, foo_group, smtpd):
testclient.get("/logout")
res = testclient.get(url, status=200)

assert res.form["user_name"].value == "someone"
assert "readonly" in res.form["user_name"].attrs
assert "readonly" in res.form["emails-0"].attrs
assert "readonly" in res.form["groups"].attrs

assert res.form["user_name"].value == "someone"
assert res.form["emails-0"].value == "[email protected]"
assert res.form["groups"].value == [foo_group.id]

Expand Down Expand Up @@ -77,8 +80,11 @@ def test_invitation_editable_user_name(testclient, logged_admin, foo_group, smtp

res = testclient.get(url, status=200)

assert res.form["user_name"].value == "jackyjack"
assert "readonly" not in res.form["user_name"].attrs
assert "readonly" in res.form["emails-0"].attrs
assert "readonly" in res.form["groups"].attrs

assert res.form["user_name"].value == "jackyjack"
assert res.form["emails-0"].value == "[email protected]"
assert res.form["groups"].value == [foo_group.id]

Expand Down Expand Up @@ -124,6 +130,10 @@ def test_generate_link(testclient, logged_admin, foo_group, smtpd):

res = testclient.get(url, status=200)

assert "readonly" in res.form["user_name"].attrs
assert "readonly" in res.form["emails-0"].attrs
assert "readonly" in res.form["groups"].attrs

assert res.form["user_name"].value == "sometwo"
assert res.form["emails-0"].value == "[email protected]"
assert res.form["groups"].value == [foo_group.id]
Expand Down

0 comments on commit e622567

Please sign in to comment.