diff mbox series

[2/2] tests: Skip tests that fail on SQLite DB backend

Message ID 20191201150506.91389-2-stephen@that.guru
State Accepted
Headers show
Series [1/2] settings: Add configuration for sqlite DB backend | expand

Commit Message

Stephen Finucane Dec. 1, 2019, 3:05 p.m. UTC
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 | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

Stephen Finucane Dec. 27, 2019, 1:08 p.m. UTC | #1
On Sun, 2019-12-01 at 15:05 +0000, Stephen Finucane wrote:
> 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>

Applied this and its predecessor.

Stephen
diff mbox series

Patch

diff --git a/patchwork/tests/test_list.py b/patchwork/tests/test_list.py
index 1c0503fa..c6ccd0d7 100644
--- a/patchwork/tests/test_list.py
+++ b/patchwork/tests/test_list.py
@@ -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})