Skip to content

Commit

Permalink
Merge pull request dimagi#31373 from dimagi/dm/django3-test-fixes
Browse files Browse the repository at this point in the history
Django 3.2 test fixes
  • Loading branch information
millerdev authored Mar 31, 2022
2 parents e6e0e1c + 2bf937e commit 97eb171
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<body>
<div data-name="scalar" data-value="estrella"></div><div data-name="special_chars" data-value="here&#39;s &quot;something&quot; irritating to parse &amp; deal with"></div><div data-name="list" data-value="[1, 2, 3]"></div><div data-name="maps" data-value="[{&quot;hen&quot;: &quot;brood&quot;}, {&quot;nightingale&quot;: &quot;watch&quot;}, {&quot;quail&quot;: &quot;bevy&quot;}, {&quot;starling&quot;: &quot;murmuration&quot;}]"></div>
<div data-name="scalar" data-value="estrella"></div><div data-name="special_chars" data-value="here&#x27;s &quot;something&quot; irritating to parse &amp; deal with"></div><div data-name="list" data-value="[1, 2, 3]"></div><div data-name="maps" data-value="[{&quot;hen&quot;: &quot;brood&quot;}, {&quot;nightingale&quot;: &quot;watch&quot;}, {&quot;quail&quot;: &quot;bevy&quot;}, {&quot;starling&quot;: &quot;murmuration&quot;}]"></div>
</body>
5 changes: 5 additions & 0 deletions corehq/apps/hqwebapp/templatetags/tests/test_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ def _test(self, filename, context):
expected_template = self._get_file('rendered', '{}.html'.format(filename))
expected = self._render_template(expected_template)

# Removed when Django 2.x is no longer supported
import django
if django.VERSION[0] < 3:
expected = expected.replace("&#x27;", "&#39;")

self.assertEqual(
self._normalize_whitespace(actual),
self._normalize_whitespace(expected),
Expand Down
4 changes: 2 additions & 2 deletions corehq/apps/hqwebapp/tests/test_compress_command.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os

from django.conf import settings
from django.template.loaders.app_directories import get_app_template_dirs
from django.template.utils import get_app_template_dirs
from django.test import SimpleTestCase

from nose.plugins.attrib import attr
Expand Down Expand Up @@ -35,7 +35,7 @@ def _assert_valid_import(self, line, filename):
def test_compress_offline(self):
template_dir_list = []
for template_dir in get_app_template_dirs('templates'):
if settings.BASE_DIR in template_dir:
if str(template_dir).startswith(settings.BASE_DIR):
template_dir_list.append(template_dir)

template_list = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Migration(migrations.Migration):
('date_end', models.DateTimeField(blank=True, null=True)),
('refresh_error_reason', models.CharField(choices=[(None, 'No Error'), ('token', 'Invalid Token'), ('timeout', 'Data Timeout'), ('other', 'Other...')], default=None, max_length=7, null=True)),
('refresh_error_note', models.TextField(blank=True, null=True)),
('schedule', models.ForeignKey(on_delete='cascade', to='oauth_integrations.LiveGoogleSheetSchedule')),
('schedule', models.ForeignKey(on_delete=models.CASCADE, to='oauth_integrations.LiveGoogleSheetSchedule')),
],
),
]

0 comments on commit 97eb171

Please sign in to comment.