Commit 2b6a449b by Peter Fogg

Unbreak acceptance tests in the cms.

parent 70736c1d
......@@ -29,10 +29,9 @@ def click_component_from_menu(instance_id, expected_css):
"""
elem_css = "a[data-location='%s']" % instance_id
elements = world.css_find(elem_css)
if len(elements) == 1: # Multiple templates
assert(len(elements) == 1)
if elements[0]['id'] == instance_id: # If this is a component with multiple templates
world.css_click(elem_css)
else: # Single template
assert(len(filter(lambda ele: ele.has_class('single-template'), elements)) == 1)
assert_equal(1, len(world.css_find(expected_css)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment