Skip to content

Commit

Permalink
✨ Skip stripe tests if no stripe secret in test settings set
Browse files Browse the repository at this point in the history
  • Loading branch information
pajowu authored and stefanw committed Apr 22, 2024
1 parent 6e1e735 commit e3da0ca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dev.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
with import <nixpkgs> { };
let
dontCheckPython = drv: drv.overridePythonAttrs (old: { doCheck = false; });
pythonPackages = python39Packages;
pythonPackages = python310Packages;

harfbuzz_self = harfbuzz.override { withCoreText = true; };
ld_packages = [
Expand Down Expand Up @@ -75,5 +75,7 @@ pkgs.mkShell {
glib
libcxx
cmake

stripe-cli
] ++ (lib.optional stdenv.isDarwin pkgs.darwin.apple_sdk.frameworks.CoreText);
}
8 changes: 8 additions & 0 deletions fragdenstaat_de/fds_donation/tests/test_stripe.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ def make_webhook_events(self, log: str):
return [WebhookEvent(*m.groups()) for m in self.WH_EVENT_RE.finditer(log)]


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


@pytest.fixture
def stripe_sepa_setup(settings, live_server, monkeypatch):
settings.SITE_URL = live_server.url
Expand Down

0 comments on commit e3da0ca

Please sign in to comment.