Skip to content

Commit

Permalink
[#2494] Fix broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Oderbolz committed Jul 1, 2015
1 parent b27e31e commit ae10c83
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions ckan/tests/controllers/test_util.py
Expand Up @@ -45,28 +45,28 @@ def test_redirect_no_params_2(self):
def test_set_timezone_valid(self):
app = self._get_test_app()
response = app.get(
url=url_for(controller='util', action='set_timezone_offset') + '/600',
url=url_for(controller='util', action='set_timezone_offset', offset='600'),
status=200,
)
assert_true('utc_timezone_offset: 600' in response)

def test_set_timezone_string(self):
app = self._get_test_app()
response = app.get(
url=url_for(controller='util', action='set_timezone_offset') + '/test',
url=url_for(controller='util', action='set_timezone_offset', offset='test'),
status=400,
)

def test_set_timezone_too_big(self):
app = self._get_test_app()
response = app.get(
url=url_for(controller='util', action='set_timezone_offset') + '/1000',
url=url_for(controller='util', action='set_timezone_offset', offset='721'),
status=400,
)

def test_set_timezone_too_big(self):
app = self._get_test_app()
response = app.get(
url=url_for(controller='util', action='set_timezone_offset') + '/-841',
url=url_for(controller='util', action='set_timezone_offset', offset='-841'),
status=400,
)
4 changes: 2 additions & 2 deletions ckan/tests/legacy/lib/test_helpers.py
Expand Up @@ -28,7 +28,7 @@ def test_render_datetime(self):

def test_render_datetime_with_hours(self):
res = h.render_datetime(datetime.datetime(2008, 4, 13, 20, 40, 20, 123456), with_hours=True)
assert_equal(res, 'April 13, 2008, 20:40')
assert_equal(res, 'April 13, 2008, 20:40 (UTC+0)')

def test_render_datetime_but_from_string(self):
res = h.render_datetime('2008-04-13T20:40:20.123456')
Expand All @@ -41,7 +41,7 @@ def test_render_datetime_blank(self):
def test_render_datetime_with_utc_offset_from_session(self):
session['utc_timezone_offset'] = 120
res = h.render_datetime(datetime.datetime(2008, 4, 13, 20, 40, 20, 123456), with_hours=True)
assert_equal(res, 'April 13, 2008, 22:40')
assert_equal(res, 'April 13, 2008, 22:40 (UTC+2)')

def test_datetime_to_date_str(self):
res = datetime.datetime(2008, 4, 13, 20, 40, 20, 123456).isoformat()
Expand Down

0 comments on commit ae10c83

Please sign in to comment.