File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1029,6 +1029,7 @@ class OrderedModelAdminWithCustomPKInlineTest(TestCase):
1029
1029
def setUp (self ):
1030
1030
User .objects .create_superuser ("admin" , "a@example.com" , "admin" )
1031
1031
self .assertTrue (self .client .login (username = "admin" , password = "admin" ))
1032
+
1032
1033
group = CustomPKGroup .objects .create (name = "g1" )
1033
1034
CustomPKGroupItem .objects .create (name = "g1 i1" , group = group )
1034
1035
CustomPKGroupItem .objects .create (name = "g1 i2" , group = group )
@@ -1103,7 +1104,12 @@ def test_reorder_with_respect_to(self):
1103
1104
1104
1105
GroupedItem .objects .create (group = group2 )
1105
1106
GroupedItem .objects .create (group = group2 )
1106
- GroupedItem .objects .create (group = group2 )
1107
+ gi2 = GroupedItem .objects .create (group = group2 )
1108
+
1109
+ self .assertEqual (GroupedItem .get_order_with_respect_to (), ("group__user" ,))
1110
+
1111
+ with assertNumQueries (self , 1 ):
1112
+ GroupedItem .objects .get (id = gi2 .id )
1107
1113
1108
1114
out = StringIO ()
1109
1115
call_command ("reorder_model" , "tests.GroupedItem" , verbosity = 1 , stdout = out )
You can’t perform that action at this time.
0 commit comments