Commits

Alex Ulianytskyi committed 8a36b64

Добавлен утверждение @asserQuerySetByPKList@ в @django_utils.test@

Comments (0)

Files changed (1)

+# -*- coding: utf-8 -*-
+from django import test
+
+class TestCase(test.TestCase):
+    def assertQuerySetByPKList(self, expected, actual, message=''):
+        '''
+        ``expected`` must be a list of ``pk`` field for ``QuerySet`` and ordered with ``pk``
+        ``actual`` must be a ``QuerySet``
+        '''
+        return self.assertEqual(expected, list(actual.values_list('pk', flat=True).order_by('pk')), message)
+