From e1fe52639b6d9e87c621fc9df4f42b8f23e936c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Barrag=C3=A1n=20Merino?= Date: Wed, 10 Feb 2016 22:17:00 +0100 Subject: [PATCH] Fix test --- tests/integration/test_hooks_bitbucket.py | 20 -------------------- tests/integration/test_hooks_gitlab.py | 21 --------------------- 2 files changed, 41 deletions(-) diff --git a/tests/integration/test_hooks_bitbucket.py b/tests/integration/test_hooks_bitbucket.py index 31d20fd0..a50b02ca 100644 --- a/tests/integration/test_hooks_bitbucket.py +++ b/tests/integration/test_hooks_bitbucket.py @@ -102,26 +102,6 @@ def test_ok_signature_invalid_network(client): assert "Bad signature" in response.data["_error_message"] -def test_blocked_project(client): - project = f.ProjectFactory(blocked_code=project_choices.BLOCKED_BY_STAFF) - f.ProjectModulesConfigFactory(project=project, config={ - "bitbucket": { - "secret": "tpnIwJDz4e" - } - }) - - url = reverse("bitbucket-hook-list") - url = "{}?project={}&key={}".format(url, project.id, "tpnIwJDz4e") - data = json.dumps({"push": {"changes": [{"new": {"target": { "message": "test message"}}}]}}) - response = client.post(url, - data, - content_type="application/json", - HTTP_X_EVENT_KEY="repo:push", - REMOTE_ADDR=settings.BITBUCKET_VALID_ORIGIN_IPS[0]) - - assert response.status_code == 451 - - def test_invalid_ip(client): project = f.ProjectFactory() f.ProjectModulesConfigFactory(project=project, config={ diff --git a/tests/integration/test_hooks_gitlab.py b/tests/integration/test_hooks_gitlab.py index 096eb7f1..0f5ee616 100644 --- a/tests/integration/test_hooks_gitlab.py +++ b/tests/integration/test_hooks_gitlab.py @@ -118,27 +118,6 @@ def test_ok_signature_invalid_network(client): assert "Bad signature" in response.data["_error_message"] - -def test_blocked_project(client): - project = f.ProjectFactory(blocked_code=project_choices.BLOCKED_BY_STAFF) - f.ProjectModulesConfigFactory(project=project, config={ - "gitlab": { - "secret": "tpnIwJDz4e", - "valid_origin_ips": ["111.111.111.111"], - } - }) - - url = reverse("gitlab-hook-list") - url = "{}?project={}&key={}".format(url, project.id, "tpnIwJDz4e") - data = {"test:": "data"} - response = client.post(url, - json.dumps(data), - content_type="application/json", - REMOTE_ADDR="111.111.111.111") - - assert response.status_code == 451 - - def test_invalid_ip(client): project = f.ProjectFactory() f.ProjectModulesConfigFactory(project=project, config={