Skip to content

Commit

Permalink
Revert "Controllers that return None should be an HTTP 204."
Browse files Browse the repository at this point in the history
This reverts commit fbcc2c2.
  • Loading branch information
ryanpetrello committed Sep 27, 2016
1 parent 6de2bae commit 4cfe319
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
2 changes: 0 additions & 2 deletions pecan/core.py
Expand Up @@ -422,8 +422,6 @@ def render(self, template, namespace):
self.default_renderer,
self.template_path
)
if namespace is None:
return None
return renderer.render(template, namespace)

def find_controller(self, state):
Expand Down
23 changes: 0 additions & 23 deletions pecan/tests/test_base.py
Expand Up @@ -2018,29 +2018,6 @@ def index(self, name='Bill'):
assert r.status_int == 200
assert r.body == b_("Bill")

def test_template_with_no_namespace(self):
class RootController(object):
@expose('mako:mako.html')
def index(self):
return None

app = TestApp(Pecan(
RootController(),
template_path=self.template_path
))
r = app.get('/')
self.assertEqual(r.status_int, 204)

def test_json_with_no_namespace(self):
class RootController(object):
@expose('json')
def index(self):
return None

app = TestApp(Pecan(RootController()))
r = app.get('/')
self.assertEqual(r.status_int, 204)


class TestDeprecatedRouteMethod(PecanTestCase):

Expand Down

0 comments on commit 4cfe319

Please sign in to comment.