Skip to content

Commit

Permalink
Fixing the tests for py3
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Mar 29, 2016
1 parent 60bce9e commit 8e27099
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ babel
_build
_static
caravel/bin/caravelc
envpy3
env_py3
.eggs
build
*.db
tmp
Expand Down
3 changes: 2 additions & 1 deletion caravel/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def iter_choices(self):
if value:
yield d.pop(value)
while d:
yield d.pop(d.keys()[0])
yield d.popitem(last=False)[1]


class FreeFormSelect(widgets.Select):
Expand Down Expand Up @@ -82,6 +82,7 @@ def get_field(self, fieldname):
return getattr(self, fieldname)

def field_css_classes(self, fieldname):
print(fieldname, self.css_classes[fieldname])
if fieldname in self.css_classes:
return " ".join(self.css_classes[fieldname])
return ""
Expand Down
2 changes: 1 addition & 1 deletion caravel/templates/caravel/explore.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
{% for fieldname in fieldset.fields %}
{% if not fieldname %}
<hr/>
{% elif not fieldname.__iter__ %}
{% elif fieldname is string %}
{{ panofield(fieldname) }}
{% else %}
<div class="row">
Expand Down
3 changes: 2 additions & 1 deletion caravel/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,9 @@ def explore(self, datasource_type, datasource_id):
else:
template = "caravel/explore.html"

resp = self.render_template(template, viz=obj, slice=slc)
try:
resp = self.render_template(template, viz=obj, slice=slc)
pass
except Exception as e:
if config.get("DEBUG"):
raise(e)
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
'flask-cache>=0.13.1, <0.14.0',
'flask-migrate>=1.5.1, <2.0.0',
'flask-script>=2.0.5, <3.0.0',
'flask-sqlalchemy==2.0.0',
'flask-testing>=0.4.2, <0.5.0',
'flask>=0.10.1, <1.0.0',
'humanize>=0.5.1, <0.6.0',
Expand Down
6 changes: 3 additions & 3 deletions tests/core_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def test_dashboard(self):
urls[dash.dashboard_title] = dash.url
for title, url in urls.items():
print(url)
assert escape(title) in self.client.get(url).data
assert escape(title) in self.client.get(url).data.decode('utf-8')

def test_doctests(self):
modules = [utils]
Expand All @@ -80,8 +80,8 @@ def test_doctests(self):
raise Exception("Failed a doctest")

def test_misc(self):
assert self.client.get('/health').data == "OK"
assert self.client.get('/ping').data == "OK"
assert self.client.get('/health').data.decode('utf-8') == "OK"
assert self.client.get('/ping').data.decode('utf-8') == "OK"


if __name__ == '__main__':
Expand Down

0 comments on commit 8e27099

Please sign in to comment.