Skip to content

Commit

Permalink
fixing ci tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eadwinCode committed Dec 9, 2023
1 parent 6cb65dc commit 2327b83
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 13 deletions.
5 changes: 0 additions & 5 deletions tests/test_async_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,12 @@ async def auth_with_sync_auth(request):
TOKEN = "1bcdefghij2bcdefghij3bcdefghij4bcdefghij5bcdefghij6bcdefghijABCD"
COOKIES = {settings.CSRF_COOKIE_NAME: TOKEN}

@pytest.mark.asyncio
async def test_auth_with_sync_auth_fails():
async_client = TestAsyncClient(csrf_ON)
res = await async_client.post("/post-async-sync-auth")
assert res.status_code == 401
assert res.json() == {"detail": "Authentication credentials were not provided."}

@pytest.mark.asyncio
async def test_auth_with_sync_auth_works():
async_client = TestAsyncClient(csrf_ON)
res = await async_client.post(
Expand All @@ -116,13 +114,11 @@ async def test_auth_with_sync_auth_works():
assert res.status_code == 200
assert res.json() == {"success": True}

@pytest.mark.asyncio
async def test_csrf_off():
async_client = TestAsyncCSRFClient(csrf_OFF)
res = await async_client.post("/post", COOKIES=COOKIES)
assert res.status_code == 200

@pytest.mark.asyncio
async def test_csrf_on():
async_client = TestAsyncCSRFClient(csrf_ON)
res = await async_client.post("/post", COOKIES=COOKIES)
Expand Down Expand Up @@ -159,7 +155,6 @@ async def test_csrf_on():


@pytest.mark.skipif(django.VERSION < (3, 1), reason="requires django 3.1 or higher")
@pytest.mark.asyncio
@pytest.mark.parametrize(
"path,kwargs,expected_code,expected_body",
[
Expand Down
1 change: 0 additions & 1 deletion tests/test_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ def sync_endpoint(self, request):


@pytest.mark.skipif(django.VERSION < (3, 1), reason="requires django 3.1 or higher")
@pytest.mark.asyncio
class TestAsyncOperations:
if not django.VERSION < (3, 1):

Expand Down
1 change: 0 additions & 1 deletion tests/test_ordering.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ def test_case9(self):


@pytest.mark.skipif(django.VERSION < (3, 1), reason="requires django 3.1 or higher")
@pytest.mark.asyncio
@pytest.mark.django_db
class TestAsyncOrdering:
if not django.VERSION < (3, 1):
Expand Down
1 change: 0 additions & 1 deletion tests/test_pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ def test_case6(self):


@pytest.mark.skipif(django.VERSION < (3, 1), reason="requires django 3.1 or higher")
@pytest.mark.asyncio
class TestAsyncOperations:
if not django.VERSION < (3, 1):

Expand Down
1 change: 0 additions & 1 deletion tests/test_route.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ def view_func(request):


@pytest.mark.skipif(django.VERSION < (3, 1), reason="requires django 3.1 or higher")
@pytest.mark.asyncio
async def test_async_route_function():
@api_controller()
class AsyncSomeTestController(SomeTestController):
Expand Down
1 change: 0 additions & 1 deletion tests/test_searching.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ def test_case5(self):


@pytest.mark.skipif(django.VERSION < (3, 1), reason="requires django 3.1 or higher")
@pytest.mark.asyncio
@pytest.mark.django_db
class TestAsyncSearch:
if not django.VERSION < (3, 1):
Expand Down
1 change: 0 additions & 1 deletion tests/test_testclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def test_add_works(self):
class TestTestAsyncClient:
if not django.VERSION < (3, 1):

@pytest.mark.asyncio
async def test_add_async_works(self):
client = TestAsyncClient(router)
res = await client.get("/add-async", query={"a": 4, "b": 6})
Expand Down
1 change: 0 additions & 1 deletion tests/test_throthling/test_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ def test_request_throttling_for_dynamic_throttling(self, monkeypatch):


@pytest.mark.skipif(django.VERSION < (3, 1), reason="requires django 3.1 or higher")
@pytest.mark.asyncio
async def test_async_throttling(monkeypatch):
api_async = NinjaExtraAPI(urls_namespace="decorator_async_1")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ def test_request_throttling_for_dynamic_throttling(self, monkeypatch):


@pytest.mark.skipif(django.VERSION < (3, 1), reason="requires django 3.1 or higher")
@pytest.mark.asyncio
async def test_async_controller_throttling(monkeypatch):
@api_controller
class ThrottledControllerAsync:
Expand Down

0 comments on commit 2327b83

Please sign in to comment.