detect errors on the final page

This commit is contained in:
Romain Bignon 2011-09-15 16:46:22 +02:00
commit 105f187d94

View file

@ -75,6 +75,14 @@ class RoadmapConfirmPage(BasePage):
class RoadmapPage(BasePage):
def get_steps(self):
errors = []
for p in self.parser.select(self.document.getroot(), 'p.errors'):
if p.text:
errors.append(p.text.strip())
if len(errors) > 0:
raise RoadmapError('Unable to establish a roadmap: %s' % ', '.join(errors))
current_step = None
i = 0
for tr in self.parser.select(self.document.getroot(), 'table.horaires2 tbody tr'):