Skip to content

Commit

Permalink
Fix as_urlpatterns test broken in merge with master
Browse files Browse the repository at this point in the history
  • Loading branch information
SmileyChris committed May 15, 2019
1 parent 62a1f1c commit 708aa91
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions bedrock/mozorg/tests/test_hierarchy.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,8 @@ def test_url_none(self):


class TestPageRoot(TestCase):
@patch('bedrock.mozorg.hierarchy.patterns')
@patch.object(PageNode, 'page')
def test_as_urlpatterns(self, page, patterns):
def test_as_urlpatterns(self, page):
"""
as_urlpatterns should return a urlconf with the pages for all the nodes
included in the tree.
Expand All @@ -215,15 +214,7 @@ def test_as_urlpatterns(self, page, patterns):
root = PageRoot('root', path='badsbi', template='fake3.html',
children=[parent])

patterns.return_value = 'asdf'
# Mocking properties
page.__get__ = lambda mock, self, cls: self.display_name

assert root.as_urlpatterns() == 'asdf'

args = patterns.call_args[0]
assert args[0] == ''
assert 'child1' in args
assert 'child2' in args
assert 'root' in args
assert 'parent' not in args
assert root.as_urlpatterns() == ['root', 'child1', 'child2']

0 comments on commit 708aa91

Please sign in to comment.