@@ -554,16 +554,31 @@ def test_negative_indexing_works_properly(self):
554554 def test_slicing_works_properly (self ):
555555 q = TestModel .objects (test_id = 0 ).order_by ('attempt_id' )
556556 expected_order = [0 , 1 , 2 , 3 ]
557+
557558 for model , expect in zip (q [1 :3 ], expected_order [1 :3 ]):
558- assert model .attempt_id == expect
559+ self .assertEqual (model .attempt_id , expect )
560+
561+ for model , expect in zip (q [0 :3 :2 ], expected_order [0 :3 :2 ]):
562+ self .assertEqual (model .attempt_id , expect )
559563
560564 def test_negative_slicing (self ):
561565 q = TestModel .objects (test_id = 0 ).order_by ('attempt_id' )
562566 expected_order = [0 , 1 , 2 , 3 ]
567+
563568 for model , expect in zip (q [- 3 :], expected_order [- 3 :]):
564- assert model .attempt_id == expect
569+ self .assertEqual (model .attempt_id , expect )
570+
565571 for model , expect in zip (q [:- 1 ], expected_order [:- 1 ]):
566- assert model .attempt_id == expect
572+ self .assertEqual (model .attempt_id , expect )
573+
574+ for model , expect in zip (q [1 :- 1 ], expected_order [1 :- 1 ]):
575+ self .assertEqual (model .attempt_id , expect )
576+
577+ for model , expect in zip (q [- 3 :- 1 ], expected_order [- 3 :- 1 ]):
578+ self .assertEqual (model .attempt_id , expect )
579+
580+ for model , expect in zip (q [- 3 :- 1 :2 ], expected_order [- 3 :- 1 :2 ]):
581+ self .assertEqual (model .attempt_id , expect )
567582
568583
569584class TestQuerySetValidation (BaseQuerySetUsage ):
0 commit comments