-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c99ccb3
commit 2c6b4e7
Showing
6 changed files
with
15 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
default_app_config = "github_webhooks.apps.GitHubWebhooksAppConfig" | ||
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
SECRET_KEY = "fake-key" | ||
ROOT_URLCONF = "tests.test_app.urls" | ||
INSTALLED_APPS = ( | ||
"github_webhooks", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from django.urls import reverse, resolve | ||
|
||
|
||
def test_receive_url(): | ||
assert reverse("github-webhook:receive") == "/github/webhook/receive/" | ||
assert resolve("/github/webhook/receive/").view_name == "github-webhook:receive" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
from django.test import Client | ||
from django.urls import reverse | ||
from django.test import RequestFactory | ||
from github_webhooks import views | ||
|
||
|
||
def test_github_webhook_view(client: Client): | ||
url = reverse("github:receive") | ||
response = client.post(url) | ||
def test_github_webhook_view(rf: RequestFactory): | ||
request = rf.post("/fake-url/") | ||
response = views.GitHubWebhookView().post(request) | ||
|
||
assert response.status_code == 200 |