Skip to content

Commit

Permalink
✨ Skip paypal tests if no paypal secret in test settings set
Browse files Browse the repository at this point in the history
  • Loading branch information
pajowu committed Jan 22, 2025
1 parent 5c14e64 commit 71baa17
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion fragdenstaat_de/fds_donation/tests/test_paypal.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ def setup_webhook(self):
process_args = [
"ssh",
"-o",
"StrictHostKeyChecking=no",
"StrictHostKeyChecking=no", # Accept new hostkeys
"-o",
"UserKnownHostsFile=/dev/null", # Don't write new hostkeys to users known hosts file
"-q", # Quiet mode
"-n", # Redirect stdin from /dev/null
"-T", # Disable pseudo-tty allocation
"-R",
Expand Down Expand Up @@ -95,6 +98,14 @@ def __exit__(self, exc_type, exc_val, exc_tb):
self.proc.stop()


@pytest.fixture(autouse=True)
def skip_paypal_if_no_key(request, settings):
if request.node.get_closest_marker("paypal"):
secret_key = settings.PAYMENT_VARIANTS["paypal"][1]["secret"]
if not secret_key:
pytest.skip("skipped paypal test because paypal secret is not set")


@pytest.fixture
def paypal_setup(settings, live_server, monkeypatch):
"""
Expand Down

0 comments on commit 71baa17

Please sign in to comment.