Skip to content

Commit

Permalink
fixed errors from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wfehr committed Jan 13, 2023
1 parent 424bcee commit b8b9703
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
1 change: 1 addition & 0 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase
from django.utils.timezone import now

from time_wizard.models import (
AbsolutePeriodModel, HolidayRangePeriodModel, TimeWizardModel,
)
Expand Down
5 changes: 2 additions & 3 deletions tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ def test_load_holidays(self):
response = load_holidays(request)
holiday_cls = getattr(holidays, 'US')
holidays_list = holiday_cls(years=now().year, prov='AL')
content = str(response.content)
content = content.replace(''', "'")
content = response.content.decode("utf-8").replace(''', "'")
self.assertIn('<option value="">---------</option>', content)
for date, name in holidays_list.items():
html = '<option value="{0}">{0} ('.format(name)
Expand All @@ -25,7 +24,7 @@ def test_load_holidays(self):
def test_load_provinces(self):
request = self.rf.get('/test/', {'country': 'US'})
response = load_provinces(request)
content = str(response.content)
content = response.content.decode("utf-8").replace('&#x27;', "'")
self.assertIn('<option value="">---------</option>', content)
for province in TIME_WIZARD_COUNTRY_PROVINCES['US']:
html = '<option value="{0}">{0}</option>'.format(province)
Expand Down
2 changes: 0 additions & 2 deletions time_wizard/workarounds.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# workarounds.py contains workarounds and monkey-patches for external issues.


# TODO: Remove on release with bugfix
# Problem: problems with polymorphic and on_delete=CASCADE
# Issue: https://github.com/django-polymorphic/django-polymorphic/issues/
Expand Down
2 changes: 0 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ default_section = THIRDPARTY
include_trailing_comma = true
known_first_party = time_wizard
line_length = 79
lines_after_import = 2
multi_line_output = 5
not_skip = __init__.py
skip = migrations

[testenv]
Expand Down

0 comments on commit b8b9703

Please sign in to comment.