Commit bb742269 by dragonfi

pep8

parent 1c2b94dc
......@@ -77,7 +77,7 @@ class QuestionnaireAbstractBlock(LightChild, StepMixin):
name = self.__class__.__name__
if str(self.type) not in self.valid_types:
raise ValueError, u'Invalid value for {}.type: `{}`'.format(name, self.type)
raise ValueError('Invalid value for {}.type: `{}`'.format(name, self.type))
template_path = 'templates/html/{}_{}.html'.format(name.lower(), self.type)
html = render_js_template(template_path, {
......
......@@ -98,8 +98,8 @@ class MentoringTableColumnBlock(LightChild):
"""
The content of the column
"""
fragment, named_children = self.get_children_fragment(context,
view_name='mentoring_table_view',
fragment, named_children = self.get_children_fragment(
context, view_name='mentoring_table_view',
not_instance_of=MentoringTableColumnHeaderBlock)
fragment.add_content(render_template('templates/html/mentoring-table-column.html', {
'self': self,
......@@ -111,8 +111,8 @@ class MentoringTableColumnBlock(LightChild):
"""
The content of the column's header
"""
fragment, named_children = self.get_children_fragment(context,
view_name='mentoring_table_header_view',
fragment, named_children = self.get_children_fragment(
context, view_name='mentoring_table_header_view',
instance_of=MentoringTableColumnHeaderBlock)
fragment.add_content(render_template('templates/html/mentoring-table-header.html', {
'self': self,
......@@ -131,4 +131,3 @@ class MentoringTableColumnHeaderBlock(LightChild):
fragment = super(MentoringTableColumnHeaderBlock, self).children_view(context)
fragment.add_content(unicode(self.content))
return fragment
......@@ -33,6 +33,7 @@ from .utils import load_scenarios_from_path
# Classes ###########################################################
class MentoringBaseTest(SeleniumTest):
def setUp(self):
......@@ -57,7 +58,6 @@ class MentoringBaseTest(SeleniumTest):
wait = WebDriverWait(submit, 10)
wait.until(lambda s: not s.is_enabled(), "{} should be disabled".format(submit.text))
def go_to_page(self, page_name, css_selector='div.mentoring'):
"""
Navigate to the page `page_name`, as listed on the workbench home
......@@ -68,4 +68,3 @@ class MentoringBaseTest(SeleniumTest):
time.sleep(1)
mentoring = self.browser.find_element_by_css_selector(css_selector)
return mentoring
......@@ -45,10 +45,9 @@ def commas_to_set(commas_str):
else:
return set(commas_str.split(','))
# Classes ###########################################################
class TipBlock(LightChild):
"""
Each choice can define a tip depending on selection
......
......@@ -33,6 +33,7 @@ log = logging.getLogger(__name__)
# Classes ###########################################################
class TitleBlock(LightChild):
"""
A simple html representation of a title, with the mentoring weight.
......
......@@ -98,4 +98,3 @@ class AnswerBlockTest(MentoringBaseTest):
# Submit is disabled after submission
self.wait_until_disabled(submit)
......@@ -76,7 +76,9 @@ class MentoringProgressionTest(MentoringBaseTest):
messages = mentoring.find_element_by_css_selector('.messages')
self.assertTrue(messages.is_displayed())
self.assertIn('You need to complete all previous steps before being able to complete the current one.', messages.text)
self.assertIn(
'You need to complete all previous steps before being able to complete the current one.',
messages.text)
mentoring = self.go_to_page('Progression 2')
warning = mentoring.find_element_by_css_selector('.warning')
......
......@@ -57,4 +57,3 @@ class MentoringTableBlockTest(MentoringBaseTest):
self.assertEqual(len(rows), 2)
self.assertEqual(rows[0].text, 'This is the answer #1')
self.assertEqual(rows[1].text, 'This is the answer #2')
......@@ -6,6 +6,7 @@ from mentoring import MentoringBlock
import mentoring
from mentoring.step import StepMixin, StepParentMixin
class Parent(StepParentMixin):
def get_children_objects(self):
return list(self._children)
......@@ -18,10 +19,15 @@ class Parent(StepParentMixin):
except AttributeError:
pass
class Step(StepMixin):
def __init__(self): pass
def __init__(self):
pass
class NotAStep(object):
pass
class NotAStep(object): pass
class TestStepMixin(unittest.TestCase):
def test_single_step_is_returned_correctly(self):
......@@ -39,7 +45,6 @@ class TestStepMixin(unittest.TestCase):
self.assertSequenceEqual(block.steps, [step1, step2])
def test_proper_number_is_returned_for_step(self):
block = Parent()
step1 = Step()
......@@ -73,4 +78,3 @@ class TestStepMixin(unittest.TestCase):
self.assertFalse(step1.lonely_step)
self.assertFalse(step2.lonely_step)
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