Fakultas Ilmu Komputer UI

Commit ce8b6f62 authored by Irwanto's avatar Irwanto
Browse files

[REFACTOR] Fixed codestyle issues

parent eedf84a7
Pipeline #49469 passed with stages
in 7 minutes and 55 seconds
...@@ -76,7 +76,10 @@ class AccountViewSet(viewsets.ModelViewSet): ...@@ -76,7 +76,10 @@ class AccountViewSet(viewsets.ModelViewSet):
if isinstance(self.request.user, AnonymousUser): if isinstance(self.request.user, AnonymousUser):
Account.objects.create(user=user, **serializer.validated_data) Account.objects.create(user=user, **serializer.validated_data)
else: else:
Account.objects.create(user=user, author=self.request.user.account, **serializer.validated_data) Account.objects.create(
user=user,
author=self.request.user.account,
**serializer.validated_data)
return Response( return Response(
serializer.data, status=status.HTTP_201_CREATED, serializer.data, status=status.HTTP_201_CREATED,
......
...@@ -13,7 +13,7 @@ class CustomAuthTest(APITestCase): ...@@ -13,7 +13,7 @@ class CustomAuthTest(APITestCase):
user = User.objects.create(username="jonathan") user = User.objects.create(username="jonathan")
user.set_password("justpass") user.set_password("justpass")
user.save() user.save()
cls.user = user cls.user = user
def _test_success(self, data): def _test_success(self, data):
response = self.client.post(path=self.URL, data=data, format="json") response = self.client.post(path=self.URL, data=data, format="json")
......
...@@ -19,4 +19,4 @@ class CustomAuthToken(ObtainAuthToken): ...@@ -19,4 +19,4 @@ class CustomAuthToken(ObtainAuthToken):
user = serializer.validated_data["user"] user = serializer.validated_data["user"]
token, _ = Token.objects.get_or_create(user=user) token, _ = Token.objects.get_or_create(user=user)
return Response(data={ "token": token.key }, status=status.HTTP_200_OK) return Response(data={"token": token.key}, status=status.HTTP_200_OK)
...@@ -10,15 +10,16 @@ from apps.cases.tests.factories.cases import InvestigationCaseFactory ...@@ -10,15 +10,16 @@ from apps.cases.tests.factories.cases import InvestigationCaseFactory
from apps.exportables.renderers import INVESTIGATION_CASE_RENDERER_FIELDS from apps.exportables.renderers import INVESTIGATION_CASE_RENDERER_FIELDS
def init_data(): def init_data():
InvestigationCaseFactory( InvestigationCaseFactory(
case_subject=CaseSubjectFactory( case_subject=CaseSubjectFactory(
district="Beji", district="Beji",
age=19, age=19,
is_male=True, is_male=True,
), ),
is_positive=True, is_positive=True,
) )
InvestigationCaseFactory( InvestigationCaseFactory(
case_subject=CaseSubjectFactory( case_subject=CaseSubjectFactory(
district="Cilodong", district="Cilodong",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment