]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
tests: Skip tests that fail on SQLite DB backend
authorStephen Finucane <stephen@that.guru>
Sun, 1 Dec 2019 15:05:06 +0000 (15:05 +0000)
committerStephen Finucane <stephen@that.guru>
Fri, 27 Dec 2019 13:04:46 +0000 (13:04 +0000)
These are failing due to differences in behavior of the backend. Since
this will never be used for production, we can simply skip these unit
tests and rely on the CI to catch potential issues.

Signed-off-by: Stephen Finucane <stephen@that.guru>
patchwork/tests/test_list.py

index 1c0503fa693bce9ed8330abe04337b4ed1df6bcb..c6ccd0d7ae8b99fe3a5baef6766a6945c7e6e68f 100644 (file)
@@ -4,8 +4,10 @@
 # SPDX-License-Identifier: GPL-2.0-or-later
 
 from datetime import datetime as dt
+import unittest
 import re
 
+from django.conf import settings
 from django.test import TestCase
 from django.urls import reverse
 from django.utils.six.moves import zip
@@ -95,6 +97,14 @@ class PatchOrderTest(TestCase):
 
         self._test_sequence(response, test_fn)
 
+    # TODO(stephenfin): Looks like this has been resolved in Django 2.1 [1]? If
+    # not, it should be possible [2]
+    #
+    # [1] https://code.djangoproject.com/ticket/30248
+    # [2] https://michaelsoolee.com/case-insensitive-sorting-sqlite/
+    @unittest.skipIf('sqlite3' in settings.DATABASES['default']['ENGINE'],
+                     'The sqlite3 backend does not support case insensitive '
+                     'ordering')
     def test_submitter_order(self):
         url = reverse('patch-list',
                       kwargs={'project_id': self.project.linkname})
@@ -106,6 +116,9 @@ class PatchOrderTest(TestCase):
 
         self._test_sequence(response, test_fn)
 
+    @unittest.skipIf('sqlite3' in settings.DATABASES['default']['ENGINE'],
+                     'The sqlite3 backend does not support case insensitive '
+                     'ordering')
     def test_submitter_reverse_order(self):
         url = reverse('patch-list',
                       kwargs={'project_id': self.project.linkname})