@@ -23,10 +23,10 @@ def setUp(self):
23
23
24
24
def test_content_type_extension (self ):
25
25
"""Test that the correct content type is accepted
26
-
26
+
27
27
The media type and parameters are defined at https://jsonapi.org/ext/atomic. This tests
28
28
hardcodes the value to separate the test from the library's constants.
29
-
29
+
30
30
"""
31
31
operations = []
32
32
@@ -538,7 +538,7 @@ def test_view_processing_with_lid_substitution(self):
538
538
"text" : "JSON API paints my bikeshed!"
539
539
}
540
540
}
541
- },
541
+ },
542
542
{
543
543
"op" : "add" ,
544
544
"data" : {
@@ -548,7 +548,7 @@ def test_view_processing_with_lid_substitution(self):
548
548
"text" : "JSON API paints my bikeshed!"
549
549
}
550
550
}
551
- },{
551
+ }, {
552
552
"op" : "update" ,
553
553
"data" : {
554
554
"lid" : "valid-lid-1" ,
@@ -675,7 +675,6 @@ def test_view_processing_with_lid_substitution(self):
675
675
676
676
self .assertDictEqual (expected_result ,
677
677
json .loads (response .content ))
678
-
679
678
680
679
# check db content
681
680
self .assertEqual (1 , BasicModel .objects .count ())
@@ -693,7 +692,6 @@ def test_view_processing_with_lid_substitution(self):
693
692
# with django 4.2 TransactionTestCase.assertQuerysetEqual() is deprecated in favor of assertQuerySetEqual().
694
693
self .assertQuerySetEqual (RelatedModelTwo .objects .filter (pk__in = [1 , 2 ]),
695
694
BasicModel .objects .get (pk = 2 ).to_many .all ())
696
-
697
695
698
696
def test_view_processing_with_invalid_lid (self ):
699
697
operations = [
@@ -735,7 +733,7 @@ def test_view_processing_with_invalid_lid(self):
735
733
error = json .loads (response .content )
736
734
expected_error = {
737
735
"errors" : [
738
- {
736
+ {
739
737
"id" : "unknown-lid" ,
740
738
"detail" : f'Object with lid `invalid-lid-test-2` received for operation with index `1` does not exist' ,
741
739
"source" : {
@@ -797,7 +795,7 @@ def test_view_processing_with_lid_type_mismatch(self):
797
795
error = json .loads (response .content )
798
796
expected_error = {
799
797
"errors" : [
800
- {
798
+ {
801
799
"id" : "unknown-lid" ,
802
800
"detail" : f'Object with lid `lid-type-mismatch-1` received for operation with index `2` does not exist' ,
803
801
"source" : {
@@ -821,7 +819,7 @@ def test_adding_resource_with_lid_relationship(self):
821
819
"text" : "JSON API paints my bikeshed!"
822
820
}
823
821
},
824
- },
822
+ },
825
823
{
826
824
"op" : "add" ,
827
825
"data" : {
@@ -841,7 +839,7 @@ def test_adding_resource_with_lid_relationship(self):
841
839
"text" : "JSON API paints my bikeshed!"
842
840
}
843
841
},
844
- },{
842
+ }, {
845
843
"op" : "add" ,
846
844
"data" : {
847
845
"type" : "BasicModel" ,
@@ -869,7 +867,7 @@ def test_adding_resource_with_lid_relationship(self):
869
867
}
870
868
}
871
869
}
872
- },
870
+ },
873
871
]
874
872
875
873
data = {
@@ -948,4 +946,4 @@ def test_adding_resource_with_lid_relationship(self):
948
946
}
949
947
950
948
self .assertDictEqual (expected_result ,
951
- json .loads (response .content ))
949
+ json .loads (response .content ))
0 commit comments