Browse Source

changed pytest marker

funding-tag
Holger Frey 7 months ago
parent
commit
9a8cf47565
  1. 12
      tests/functional/test_login.py
  2. 8
      tests/functional/test_my_account.py
  3. 28
      tests/functional/test_order.py
  4. 16
      tests/functional/test_order_list.py
  5. 14
      tests/functional/test_password_reset.py
  6. 12
      tests/functional/test_registration.py
  7. 16
      tests/functional/test_user_edit.py
  8. 12
      tests/functional/test_vendors.py

12
tests/functional/test_login.py

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
import pytest
@pytest.mark.fun
@pytest.mark.functional
def test_login_ok(testapp):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -13,7 +13,7 @@ def test_login_ok(testapp): @@ -13,7 +13,7 @@ def test_login_ok(testapp):
assert "My Orders" in response
@pytest.mark.fun
@pytest.mark.functional
def test_login_wrong_username(testapp):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -25,7 +25,7 @@ def test_login_wrong_username(testapp): @@ -25,7 +25,7 @@ def test_login_wrong_username(testapp):
assert "Credentials are invalid" in response
@pytest.mark.fun
@pytest.mark.functional
def test_login_wrong_password(testapp):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -37,7 +37,7 @@ def test_login_wrong_password(testapp): @@ -37,7 +37,7 @@ def test_login_wrong_password(testapp):
assert "Credentials are invalid" in response
@pytest.mark.fun
@pytest.mark.functional
def test_login_fails_inactive_user(testapp):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -49,7 +49,7 @@ def test_login_fails_inactive_user(testapp): @@ -49,7 +49,7 @@ def test_login_fails_inactive_user(testapp):
assert "Credentials are invalid" in response
@pytest.mark.fun
@pytest.mark.functional
def test_logout(testapp):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -64,7 +64,7 @@ def test_logout(testapp): @@ -64,7 +64,7 @@ def test_logout(testapp):
assert "Please Log In" in response
@pytest.mark.fun
@pytest.mark.functional
def test_breached_faq(testapp):
response = testapp.get("/breached")
assert "haveibeenpwned" in response

8
tests/functional/test_my_account.py

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
import pytest
@pytest.mark.fun
@pytest.mark.functional
def test_my_account_edit(testapp, login_as):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -27,7 +27,7 @@ def test_my_account_edit(testapp, login_as): @@ -27,7 +27,7 @@ def test_my_account_edit(testapp, login_as):
assert "terry@example.com" in response
@pytest.mark.fun
@pytest.mark.functional
def test_my_account_edit_cancel(testapp, login_as):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -53,7 +53,7 @@ def test_my_account_edit_cancel(testapp, login_as): @@ -53,7 +53,7 @@ def test_my_account_edit_cancel(testapp, login_as):
assert "terry@example.com" not in response
@pytest.mark.fun
@pytest.mark.functional
def test_my_account_edit_form_error(testapp, login_as):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -70,7 +70,7 @@ def test_my_account_edit_form_error(testapp, login_as): @@ -70,7 +70,7 @@ def test_my_account_edit_form_error(testapp, login_as):
assert "There was a problem with your submission" in response
@pytest.mark.fun
@pytest.mark.functional
def test_my_account_reset_password(testapp, login_as, parse_latest_mail):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response

28
tests/functional/test_order.py

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
import pytest
@pytest.mark.fun
@pytest.mark.functional
def test_view_order(testapp, login_as):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -29,7 +29,7 @@ def test_view_order(testapp, login_as): @@ -29,7 +29,7 @@ def test_view_order(testapp, login_as):
assert "TestUser" in response
@pytest.mark.fun
@pytest.mark.functional
def test_add_order_ok(testapp, login_as, contains):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -84,7 +84,7 @@ def test_add_order_ok(testapp, login_as, contains): @@ -84,7 +84,7 @@ def test_add_order_ok(testapp, login_as, contains):
assert "28.35" in response
@pytest.mark.fun
@pytest.mark.functional
def test_add_order_validation_error(testapp, login_as, contains):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -116,7 +116,7 @@ def test_add_order_validation_error(testapp, login_as, contains): @@ -116,7 +116,7 @@ def test_add_order_validation_error(testapp, login_as, contains):
)
@pytest.mark.fun
@pytest.mark.functional
def test_add_order_cancel(testapp, login_as, contains):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -160,7 +160,7 @@ def test_add_order_cancel(testapp, login_as, contains): @@ -160,7 +160,7 @@ def test_add_order_cancel(testapp, login_as, contains):
)
@pytest.mark.fun
@pytest.mark.functional
def test_edit_order_ok(testapp, login_as, contains, parse_latest_mail):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -222,7 +222,7 @@ def test_edit_order_ok(testapp, login_as, contains, parse_latest_mail): @@ -222,7 +222,7 @@ def test_edit_order_ok(testapp, login_as, contains, parse_latest_mail):
assert "- new status: Hold" in parsed.body
@pytest.mark.fun
@pytest.mark.functional
def test_edit_order_form_error(testapp, login_as, contains):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -260,7 +260,7 @@ def test_edit_order_form_error(testapp, login_as, contains): @@ -260,7 +260,7 @@ def test_edit_order_form_error(testapp, login_as, contains):
)
@pytest.mark.fun
@pytest.mark.functional
def test_edit_order_cancel(testapp, login_as, contains):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -296,7 +296,7 @@ def test_edit_order_cancel(testapp, login_as, contains): @@ -296,7 +296,7 @@ def test_edit_order_cancel(testapp, login_as, contains):
)
@pytest.mark.fun
@pytest.mark.functional
def test_edit_order_purchaser_vs_user(testapp, login_as, contains): # noqa: ARG001
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -318,7 +318,7 @@ def test_edit_order_purchaser_vs_user(testapp, login_as, contains): # noqa: ARG @@ -318,7 +318,7 @@ def test_edit_order_purchaser_vs_user(testapp, login_as, contains): # noqa: ARG
assert status.has_attr("readonly")
@pytest.mark.fun
@pytest.mark.functional
def test_delete_order_ok(testapp, login_as, contains):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -344,7 +344,7 @@ def test_delete_order_ok(testapp, login_as, contains): @@ -344,7 +344,7 @@ def test_delete_order_ok(testapp, login_as, contains):
assert "/orders/4/edit" not in response
@pytest.mark.fun
@pytest.mark.functional
def test_delete_order_cancel(testapp, login_as, contains):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -370,7 +370,7 @@ def test_delete_order_cancel(testapp, login_as, contains): @@ -370,7 +370,7 @@ def test_delete_order_cancel(testapp, login_as, contains):
assert "/orders/4/edit" in response
@pytest.mark.fun
@pytest.mark.functional
def test_delete_order_no_confirm(testapp, login_as, contains):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -396,7 +396,7 @@ def test_delete_order_no_confirm(testapp, login_as, contains): @@ -396,7 +396,7 @@ def test_delete_order_no_confirm(testapp, login_as, contains):
assert "/orders/4/edit" in response
@pytest.mark.fun
@pytest.mark.functional
def test_reorder_ok(testapp, login_as, contains):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -427,7 +427,7 @@ def test_reorder_ok(testapp, login_as, contains): @@ -427,7 +427,7 @@ def test_reorder_ok(testapp, login_as, contains):
)
@pytest.mark.fun
@pytest.mark.functional
def test_reorder_cancel(testapp, login_as, contains):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -453,7 +453,7 @@ def test_reorder_cancel(testapp, login_as, contains): @@ -453,7 +453,7 @@ def test_reorder_cancel(testapp, login_as, contains):
)
@pytest.mark.fun
@pytest.mark.functional
def test_reorder_form_error(testapp, login_as, contains):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response

16
tests/functional/test_order_list.py

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
import pytest
@pytest.mark.fun
@pytest.mark.functional
def test_order_list(testapp, login_as, contains):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -60,7 +60,7 @@ def test_order_list(testapp, login_as, contains): @@ -60,7 +60,7 @@ def test_order_list(testapp, login_as, contains):
)
@pytest.mark.fun
@pytest.mark.functional
def test_multi_edit_ok(testapp, login_as, parse_latest_mail, contains):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -95,7 +95,7 @@ def test_multi_edit_ok(testapp, login_as, parse_latest_mail, contains): @@ -95,7 +95,7 @@ def test_multi_edit_ok(testapp, login_as, parse_latest_mail, contains):
assert "- new status: Hold" in parsed.body
@pytest.mark.fun
@pytest.mark.functional
def test_multi_edit_no_orders_selected(testapp, login_as, contains):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -113,7 +113,7 @@ def test_multi_edit_no_orders_selected(testapp, login_as, contains): @@ -113,7 +113,7 @@ def test_multi_edit_no_orders_selected(testapp, login_as, contains):
)
@pytest.mark.fun
@pytest.mark.functional
def test_multi_edit_cancel(testapp, login_as, contains):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -154,7 +154,7 @@ def test_multi_edit_cancel(testapp, login_as, contains): @@ -154,7 +154,7 @@ def test_multi_edit_cancel(testapp, login_as, contains):
)
@pytest.mark.fun
@pytest.mark.functional
def test_multi_delete_ok(testapp, login_as, contains):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -184,7 +184,7 @@ def test_multi_delete_ok(testapp, login_as, contains): @@ -184,7 +184,7 @@ def test_multi_delete_ok(testapp, login_as, contains):
)
@pytest.mark.fun
@pytest.mark.functional
def test_multi_delete_no_orders(testapp, login_as, contains):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -205,7 +205,7 @@ def test_multi_delete_no_orders(testapp, login_as, contains): @@ -205,7 +205,7 @@ def test_multi_delete_no_orders(testapp, login_as, contains):
)
@pytest.mark.fun
@pytest.mark.functional
def test_multi_delete_no_confirm(testapp, login_as, contains):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -235,7 +235,7 @@ def test_multi_delete_no_confirm(testapp, login_as, contains): @@ -235,7 +235,7 @@ def test_multi_delete_no_confirm(testapp, login_as, contains):
)
@pytest.mark.fun
@pytest.mark.functional
def test_multi_delete_cancel(testapp, login_as, contains):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response

14
tests/functional/test_password_reset.py

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
import pytest
@pytest.mark.fun
@pytest.mark.functional
def test_password_reset(testapp, parse_latest_mail):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -46,7 +46,7 @@ def test_password_reset(testapp, parse_latest_mail): @@ -46,7 +46,7 @@ def test_password_reset(testapp, parse_latest_mail):
assert "My Orders" in response
@pytest.mark.fun
@pytest.mark.functional
def test_password_cancel_forgot_password(testapp):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -60,7 +60,7 @@ def test_password_cancel_forgot_password(testapp): @@ -60,7 +60,7 @@ def test_password_cancel_forgot_password(testapp):
assert "Please Log In" in response
@pytest.mark.fun
@pytest.mark.functional
def test_password_reset_user_or_email_not_found(testapp):
from pyramid_mailer import get_mailer
@ -80,7 +80,7 @@ def test_password_reset_user_or_email_not_found(testapp): @@ -80,7 +80,7 @@ def test_password_reset_user_or_email_not_found(testapp):
assert len(mailer.outbox) == 0
@pytest.mark.fun
@pytest.mark.functional
def test_password_reset_cancel_after_token(testapp, parse_latest_mail):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -112,7 +112,7 @@ def test_password_reset_cancel_after_token(testapp, parse_latest_mail): @@ -112,7 +112,7 @@ def test_password_reset_cancel_after_token(testapp, parse_latest_mail):
assert "My Orders" in response
@pytest.mark.fun
@pytest.mark.functional
def test_password_reset_empty_password(testapp, parse_latest_mail):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -137,7 +137,7 @@ def test_password_reset_empty_password(testapp, parse_latest_mail): @@ -137,7 +137,7 @@ def test_password_reset_empty_password(testapp, parse_latest_mail):
assert "There was a problem with your submission" in response
@pytest.mark.fun
@pytest.mark.functional
def test_password_reset_invalid_token(testapp):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -146,7 +146,7 @@ def test_password_reset_invalid_token(testapp): @@ -146,7 +146,7 @@ def test_password_reset_invalid_token(testapp):
assert "Please Log In" in response
@pytest.mark.fun
@pytest.mark.functional
def test_password_reset_form_invalid_token(testapp, parse_latest_mail):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response

12
tests/functional/test_registration.py

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
import pytest
@pytest.mark.fun
@pytest.mark.functional
def test_registration_procedure(testapp, login_as, parse_latest_mail):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -47,7 +47,7 @@ def test_registration_procedure(testapp, login_as, parse_latest_mail): @@ -47,7 +47,7 @@ def test_registration_procedure(testapp, login_as, parse_latest_mail):
assert "My Orders" in response
@pytest.mark.fun
@pytest.mark.functional
def test_registration_procedure_form_error(
testapp,
login_as, # noqa: ARG001
@ -64,7 +64,7 @@ def test_registration_procedure_form_error( @@ -64,7 +64,7 @@ def test_registration_procedure_form_error(
assert "There was a problem with your submission" in response
@pytest.mark.fun
@pytest.mark.functional
def test_registration_procedure_not_unique_username(
testapp,
login_as, # noqa: ARG001
@ -87,7 +87,7 @@ def test_registration_procedure_not_unique_username( @@ -87,7 +87,7 @@ def test_registration_procedure_not_unique_username(
assert "There was a problem with your submission" in response
@pytest.mark.fun
@pytest.mark.functional
def test_registration_procedure_not_unique_email(
testapp,
login_as, # noqa: ARG001
@ -110,7 +110,7 @@ def test_registration_procedure_not_unique_email( @@ -110,7 +110,7 @@ def test_registration_procedure_not_unique_email(
assert "There was a problem with your submission" in response
@pytest.mark.fun
@pytest.mark.functional
def test_registration_procedure_bad_csrf_token(
testapp,
login_as, # noqa: ARG001
@ -133,7 +133,7 @@ def test_registration_procedure_bad_csrf_token( @@ -133,7 +133,7 @@ def test_registration_procedure_bad_csrf_token(
form.submit("Create_Account", status=400)
@pytest.mark.fun
@pytest.mark.functional
def test_registration_procedure_canceled(testapp, login_as, parse_latest_mail): # noqa: ARG001
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response

16
tests/functional/test_user_edit.py

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
import pytest
@pytest.mark.fun
@pytest.mark.functional
def test_user_edit(testapp, login_as):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -25,7 +25,7 @@ def test_user_edit(testapp, login_as): @@ -25,7 +25,7 @@ def test_user_edit(testapp, login_as):
assert "terry@example.com" in response
@pytest.mark.fun
@pytest.mark.functional
def test_user_edit_cancel(testapp, login_as):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -49,7 +49,7 @@ def test_user_edit_cancel(testapp, login_as): @@ -49,7 +49,7 @@ def test_user_edit_cancel(testapp, login_as):
assert "terry@example.com" not in response
@pytest.mark.fun
@pytest.mark.functional
def test_user_edit_form_error(testapp, login_as):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -64,7 +64,7 @@ def test_user_edit_form_error(testapp, login_as): @@ -64,7 +64,7 @@ def test_user_edit_form_error(testapp, login_as):
assert "There was a problem with your submission" in response
@pytest.mark.fun
@pytest.mark.functional
def test_user_edit_invalid_user(testapp, login_as):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -76,7 +76,7 @@ def test_user_edit_invalid_user(testapp, login_as): @@ -76,7 +76,7 @@ def test_user_edit_invalid_user(testapp, login_as):
assert "My Orders" in response
@pytest.mark.fun
@pytest.mark.functional
def test_user_edit_reset_password(testapp, login_as, parse_latest_mail):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -99,7 +99,7 @@ def test_user_edit_reset_password(testapp, login_as, parse_latest_mail): @@ -99,7 +99,7 @@ def test_user_edit_reset_password(testapp, login_as, parse_latest_mail):
assert parsed.link.startswith("http://localhost/reset?t=")
@pytest.mark.fun
@pytest.mark.functional
def test_user_delete(testapp, login_as, parse_latest_mail): # noqa: ARG001
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -122,7 +122,7 @@ def test_user_delete(testapp, login_as, parse_latest_mail): # noqa: ARG001 @@ -122,7 +122,7 @@ def test_user_delete(testapp, login_as, parse_latest_mail): # noqa: ARG001
assert "TestInactive" not in response
@pytest.mark.fun
@pytest.mark.functional
def test_user_delete_cancel(testapp, login_as, parse_latest_mail): # noqa: ARG001
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -145,7 +145,7 @@ def test_user_delete_cancel(testapp, login_as, parse_latest_mail): # noqa: ARG0 @@ -145,7 +145,7 @@ def test_user_delete_cancel(testapp, login_as, parse_latest_mail): # noqa: ARG0
assert "TestInactive" in response
@pytest.mark.fun
@pytest.mark.functional
def test_user_delete_no_confirm(testapp, login_as, parse_latest_mail): # noqa: ARG001
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response

12
tests/functional/test_vendors.py

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
import pytest
@pytest.mark.fun
@pytest.mark.functional
@pytest.mark.parametrize(
"vendor,returned,found",
[
@ -27,7 +27,7 @@ def test_check_vendor_name(testapp, login_as, vendor, returned, found): @@ -27,7 +27,7 @@ def test_check_vendor_name(testapp, login_as, vendor, returned, found):
assert response.json == {"name": returned, "found": found}
@pytest.mark.fun
@pytest.mark.functional
def test_vendor_list(testapp, login_as):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -42,7 +42,7 @@ def test_vendor_list(testapp, login_as): @@ -42,7 +42,7 @@ def test_vendor_list(testapp, login_as):
assert "Merck" in response
@pytest.mark.fun
@pytest.mark.functional
def test_vendor_edit_ok(testapp, login_as):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -82,7 +82,7 @@ def test_vendor_edit_ok(testapp, login_as): @@ -82,7 +82,7 @@ def test_vendor_edit_ok(testapp, login_as):
assert response.json == {"name": "vr", "found": False}
@pytest.mark.fun
@pytest.mark.functional
def test_vendor_edit_cancel(testapp, login_as):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -116,7 +116,7 @@ def test_vendor_edit_cancel(testapp, login_as): @@ -116,7 +116,7 @@ def test_vendor_edit_cancel(testapp, login_as):
assert set(terms) == {"merck", "merk"}
@pytest.mark.fun
@pytest.mark.functional
def test_vendor_edit_form_error(testapp, login_as):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response
@ -147,7 +147,7 @@ def test_vendor_edit_form_error(testapp, login_as): @@ -147,7 +147,7 @@ def test_vendor_edit_form_error(testapp, login_as):
assert "Merck" in response
@pytest.mark.fun
@pytest.mark.functional
def test_vendor_edit_unknonw_vendor(testapp, login_as):
response = testapp.get("/", status=302).follow()
assert "Please Log In" in response

Loading…
Cancel
Save