Skip to content

Commit

Permalink
Fix the registration tests
Browse files Browse the repository at this point in the history
Signed-off-by: Aurélien Bompard <[email protected]>
  • Loading branch information
abompard committed Feb 14, 2024
1 parent 0af3dab commit 791cdb4
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions tests/unit/controller/test_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def dummy_stageuser(ipa_testing_config):
o_mail="[email protected]",
o_loginshell='/bin/bash',
fascreationtime=f"{now.isoformat()}Z",
fasstatusnote="spamcheck_awaiting",
)['result']
yield User(user)
try:
Expand Down Expand Up @@ -126,7 +127,7 @@ def test_gecos(client, post_data_non_ascii, cleanup_dummy_user, mocker):
# Check that default values are added
user = User(ipa_admin.stageuser_show("dummy")['result'])

assert user.gecos == "Xi Jin Ping aeoeue ss AeOeUe Ss An Bei Jin San"
assert user.gecos == "Xi Jin Ping aeoeue ss AeOeUe SS An Bei Jin San"


@pytest.mark.vcr()
Expand Down Expand Up @@ -269,13 +270,15 @@ def test_step_1_spamcheck(


@pytest.mark.parametrize(
"spamcheck_status", ["spamcheck_awaiting", "spamcheck_denied", "spamcheck_manual"]
"spamcheck_status", ["active", "spamcheck_denied", "spamcheck_manual"]
)
@pytest.mark.vcr()
def test_spamcheck_wait(client, dummy_stageuser, spamcheck_status):
"""Test the spamcheck_wait endpoint"""
ipa_admin.stageuser_mod(a_uid="dummy", fasstatusnote=spamcheck_status)
result = client.get('/register/spamcheck-wait?username=dummy')
result = client.get(
'/register/spamcheck-wait?username=dummy', follow_redirects=True
)
assert result.status_code == 200


Expand Down Expand Up @@ -848,7 +851,6 @@ def logged_in_stage_users_admin(client, make_user, app):
sess.clear()


@pytest.mark.skip("couldnt get this to work")
@pytest.mark.vcr()
def test_registering(client, logged_in_stage_users_admin, dummy_stageuser):
response = client.get("/registering/?status=spamcheck_awaiting")
Expand Down Expand Up @@ -922,7 +924,6 @@ def test_registering_delete(client, logged_in_stage_users_admin, dummy_stageuser
assert len(outbox) == 0


@pytest.mark.skip("couldnt get this to work")
@pytest.mark.vcr()
def test_registering_invalid_action(
client, logged_in_stage_users_admin, dummy_stageuser
Expand All @@ -948,7 +949,6 @@ def test_registering_unknown_user(client, logged_in_stage_users_admin):
)


@pytest.mark.skip("couldnt get this to work")
@pytest.mark.parametrize(
"action,message",
[
Expand All @@ -975,7 +975,6 @@ def test_registering_change_status_error(
assert len(outbox) == 0


@pytest.mark.skip("couldnt get this to work")
@pytest.mark.vcr()
def test_registering_delete_error(
client,
Expand Down

0 comments on commit 791cdb4

Please sign in to comment.