From 285c7f8a06dfe5646eacd91b6709655429a53b27 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Tue, 17 Apr 2018 14:47:33 +0200 Subject: [PATCH 1/2] tests: don't care about ordering in APITests.test_project_features Fixes this specific test against postgresql --- readthedocs/rtd_tests/tests/test_api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/readthedocs/rtd_tests/tests/test_api.py b/readthedocs/rtd_tests/tests/test_api.py index 87e328e5037..05a5db62f00 100644 --- a/readthedocs/rtd_tests/tests/test_api.py +++ b/readthedocs/rtd_tests/tests/test_api.py @@ -12,6 +12,7 @@ from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.test import TestCase +from django.utils import six from django_dynamic_fixture import get from rest_framework import status from rest_framework.test import APIClient @@ -247,7 +248,8 @@ def test_project_features(self): resp = client.get('/api/v2/project/%s/' % (project.pk)) self.assertEqual(resp.status_code, 200) self.assertIn('features', resp.data) - self.assertEqual( + six.assertCountEqual( + self, resp.data['features'], [feature1.feature_id, feature2.feature_id], ) From 119ec94a9f07f4b5c68db980b052227052d3df2e Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Tue, 17 Apr 2018 15:15:13 +0200 Subject: [PATCH 2/2] tests: don't hardcode build id in NotificationBackendTests.test_email_backend Fixes running this test against postgresql --- readthedocs/rtd_tests/tests/test_notifications.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readthedocs/rtd_tests/tests/test_notifications.py b/readthedocs/rtd_tests/tests/test_notifications.py index 99f7f0940e5..cdc2fbc5c71 100644 --- a/readthedocs/rtd_tests/tests/test_notifications.py +++ b/readthedocs/rtd_tests/tests/test_notifications.py @@ -80,7 +80,7 @@ class TestNotification(Notification): request=mock.ANY, template='core/email/common.txt', context={'content': 'Test'}, - subject=u'This is 1', + subject=u'This is {}'.format(build.id), template_html='core/email/common.html', recipient=user.email, )