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
- Decorator and context manager to override settings by jezdez 2 years ago
- Google Geocode Lookup by tonyskyday 5 years, 11 months ago
- Dynamically insert or append a value to an admin option, e.g. list_display or list_filter by frankban 1 year, 9 months ago
- Dynamic query builder with AND/OR by bobwaycott 3 years, 9 months ago
- "Zoom in" on rendered HTML that the test client returns by peterbe 4 years, 1 month ago
Comments