#27203 closed Cleanup/optimization (fixed)
Update tests that use assertQuerysetEqual lambda o: o to use assertSequenceEqual
Reported by: | Tim Graham | Owned by: | nobody |
---|---|---|---|
Component: | Core (Other) | Version: | 1.10 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | yes | UI/UX: | no |
Description
For example:
-
tests/expressions/tests.py
diff --git a/tests/expressions/tests.py b/tests/expressions/tests.py index 27929c9..459d317 100644
a b class BasicExpressionsTests(TestCase): 94 94 # We can set one field to have the value of another field 95 95 # Make sure we have enough chairs 96 96 self.company_query.update(num_chairs=F("num_employees")) 97 self.assert QuerysetEqual(97 self.assertSequenceEqual( 98 98 self.company_query, [ 99 99 { 100 100 "num_chairs": 2300, … … class BasicExpressionsTests(TestCase): 112 112 "num_employees": 32 113 113 } 114 114 ], 115 lambda o: o116 115 ) 117 116 118 117 def test_arithmetic(self):
When searching for cases to replace, there might be other letters besides 'o' in lambda o: o
.
Note:
See TracTickets
for help on using tickets.
PR but it only replaces
lambda o: o
and not other letters that might be used in the expression.