From 9475af62ae92ee7e405ce2d558109bb1d3f45f97 Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 22 Jun 2021 10:12:44 +1000 Subject: [PATCH] Style fixes --- InvenTree/InvenTree/serializers.py | 2 +- InvenTree/part/test_api.py | 9 ++++++--- InvenTree/part/test_part.py | 11 ++++++----- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/InvenTree/InvenTree/serializers.py b/InvenTree/InvenTree/serializers.py index 00be9949f4..2bc89ef637 100644 --- a/InvenTree/InvenTree/serializers.py +++ b/InvenTree/InvenTree/serializers.py @@ -48,7 +48,7 @@ class InvenTreeModelSerializer(serializers.ModelSerializer): this class ensures that the underlying model is also validated. """ - # Run any native validation checks first (may throw an ValidationError) + # Run any native validation checks first (may raise a ValidationError) data = super().run_validation(data) # Now ensure the underlying model is correct diff --git a/InvenTree/part/test_api.py b/InvenTree/part/test_api.py index b7472a3b1c..6695e8725c 100644 --- a/InvenTree/part/test_api.py +++ b/InvenTree/part/test_api.py @@ -1,4 +1,5 @@ -from django.db import models +# -*- coding: utf-8 -*- + from rest_framework import status from django.urls import reverse @@ -438,7 +439,8 @@ class PartDetailTests(InvenTreeAPITestCase): url = reverse('api-part-detail', kwargs={'pk': pk}) # Attempt to alter the revision code - response = self.client.patch(url, + response = self.client.patch( + url, { 'revision': 'A', }, @@ -448,7 +450,8 @@ class PartDetailTests(InvenTreeAPITestCase): self.assertEqual(response.status_code, 400) # But we *can* change it to a unique revision code - response = self.client.patch(url, + response = self.client.patch( + url, { 'revision': 'C', } diff --git a/InvenTree/part/test_part.py b/InvenTree/part/test_part.py index cdbf19f485..b8a379d241 100644 --- a/InvenTree/part/test_part.py +++ b/InvenTree/part/test_part.py @@ -97,11 +97,12 @@ class PartTest(TestCase): self.assertEqual(Part.objects.count(), n + 1) - part = Part(category=cat, - name='part', - description='description', - IPN='IPN', - revision='A', + part = Part( + category=cat, + name='part', + description='description', + IPN='IPN', + revision='A', ) with self.assertRaises(ValidationError):