Skip to content

Commit

Permalink
Solve Lint conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasvallejosdev committed Jan 29, 2024
1 parent 7c140bb commit 3f242e3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 31 deletions.
16 changes: 5 additions & 11 deletions app/todo_api/tests/test_task_list_api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from venv import create
from django.test import TestCase
from django.urls import reverse
from django.contrib.auth import get_user_model
Expand Down Expand Up @@ -93,7 +92,6 @@ def test_retrieve_list_pk_from_name(self):

self.assertEqual(res.status_code, status.HTTP_200_OK)
self.assertEqual(list_2.id, res.data["id"])


def test_retrieve_inbox_from_name(self):
"""Test retrieve and create if inbox not exists using slug name"""
Expand All @@ -103,7 +101,7 @@ def test_retrieve_inbox_from_name(self):

self.assertEqual(res.status_code, status.HTTP_200_OK)
self.assertTrue(exists)

def test_retrieve_unique_inbox_for_each_account(self):
"""Test retrieve and create unique inbox for account"""
user_two = get_user_model().objects.create(
Expand All @@ -118,13 +116,11 @@ def test_retrieve_unique_inbox_for_each_account(self):
self.assertEqual(res.status_code, status.HTTP_200_OK)
self.assertTrue(exists)
self.assertNotEqual(list_inbox.list_uuid, list[0].list_uuid)

def test_fully_update_task_list(self):
"""Test partial update list with patch"""
list = create_task_list(user=self.user)
payload = {
"name": "New name"
}
payload = {"name": "New name"}
url = list_detail_url(list.list_uuid)
res = self.client.patch(url, payload)
self.assertEqual(res.status_code, status.HTTP_200_OK)
Expand All @@ -137,8 +133,6 @@ def test_update_unauthorized_failure(self):
)
list = create_task_list(user=new_user)
url = list_detail_url(list.list_uuid)
res = self.client.patch(url, {
"name": "new name"
})
res = self.client.patch(url, {"name": "new name"})
self.assertEqual(res.status_code, status.HTTP_404_NOT_FOUND)
self.assertNotEqual(list.name, "new name")
self.assertNotEqual(list.name, "new name")
5 changes: 3 additions & 2 deletions app/todo_api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ def retrieve(self, request, list_uuid=None, *args, **kwargs):
try:
if list_uuid == "inbox":
# case inbox os is not created
inbox = TaskList.objects.filter(name="inbox", created_by=self.request.user).exists() # noqa: E501
inbox = TaskList.objects.filter(
name="inbox", created_by=self.request.user
).exists() # noqa: E501
if not inbox:
TaskList.objects.create(name="inbox", created_by=self.request.user)
queryset = queryset.get(name__iexact="inbox")
Expand All @@ -155,4 +157,3 @@ def retrieve(self, request, list_uuid=None, *args, **kwargs):
)
serializer = self.get_serializer(queryset, many=False)
return Response(serializer.data)

18 changes: 0 additions & 18 deletions app/todo_project/wsgi.py

This file was deleted.

0 comments on commit 3f242e3

Please sign in to comment.