1 2 3 4 5 6 7 8 9 | from django.test import TestCase
class BaseTestCase(TestCase):
def assertQuerysetEqual(self, qs1, qs2):
pk = lambda o: o.pk
return self.assertEqual(
list(sorted(qs1, key=pk)),
list(sorted(qs2, key=pk))
)
|
More like this
- Fuzzy testing with assertNumQueries by spookylukey 1 year ago
- Decorator and context manager to override settings by jezdez 8 months, 4 weeks ago
- "Zoom in" on rendered HTML that the test client returns by peterbe 2 years, 9 months ago
- Multiple querysets by t_rybik 1 year, 11 months ago
- FieldLevelPermissionsAdmin by buriy 4 years, 5 months ago
Comments