-
Notifications
You must be signed in to change notification settings - Fork 9
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
Showing
18 changed files
with
138 additions
and
58 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
from django.http import HttpRequest, HttpResponse | ||
from django.shortcuts import render | ||
|
||
|
||
def index(request): | ||
def index(request: HttpRequest) -> HttpResponse: | ||
context = {} | ||
return render(request, "addtocsv/addtocsv.html.j2", context) |
Empty file.
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
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
Empty file.
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
Empty file.
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,24 @@ | ||
import django.test | ||
|
||
import findthatcharity.apps.ftc.tests | ||
from findthatcharity.api.endpoints import FtcAuthentication | ||
|
||
|
||
class ApiAuthenticationTest(django.test.TestCase): | ||
databases = {"data", "admin"} | ||
|
||
def test_authenticate_anon(self): | ||
request = django.test.RequestFactory().get("/") | ||
request.user = django.contrib.auth.models.AnonymousUser() | ||
|
||
self.assertEqual(FtcAuthentication().authenticate(request, None), None) | ||
|
||
def test_authenticate_user(self): | ||
user = django.contrib.auth.models.User.objects.create_user( | ||
username="testuser", | ||
email="[email protected]", | ||
) | ||
request = django.test.RequestFactory().get("/") | ||
request.user = user | ||
|
||
self.assertEqual(FtcAuthentication().authenticate(request, None), None) |
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,9 @@ | ||
from unittest.mock import Mock | ||
|
||
from findthatcharity.db_router import DBRouter | ||
|
||
|
||
def test_db_router__db_for_read__data_db(): | ||
router = DBRouter() | ||
model = Mock(_meta=Mock(app_label="api")) | ||
assert router.db_for_read(model) == "data" |
File renamed without changes.
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
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,3 +1,6 @@ | ||
[tool.ruff] | ||
select = ["E", "F", "I"] | ||
ignore = ['E501'] | ||
ignore = ['E501'] | ||
|
||
[tool.pytest.ini_options] | ||
DJANGO_SETTINGS_MODULE = "findthatcharity.settings" |
Oops, something went wrong.