diff options
Diffstat (limited to 'ishtar_common/tests.py')
| -rw-r--r-- | ishtar_common/tests.py | 14 | 
1 files changed, 7 insertions, 7 deletions
| diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py index defc3a0c3..c2abab10c 100644 --- a/ishtar_common/tests.py +++ b/ishtar_common/tests.py @@ -285,17 +285,17 @@ class WizardTest(object):      def pass_test(self):          return False -    def check_response(self, response, current_step): +    def check_response(self, response, current_step, data_idx):          if "errorlist" in response.content: -            soup = Soup(response.content) +            soup = Soup(response.content, "lxml")              errorlist = soup.findAll(                  "ul", {"class": "errorlist"})              errors = []              for li in errorlist:                  lbl = li.findParent().findParent().findChild().text                  errors.append(u"{} - {}".format(lbl, li.text)) -            raise ValidationError(u"Errors: {} on {}.".format( -                u" ".join(errors), current_step)) +            raise ValidationError(u"Errors: {} on {} - dataset {}.".format( +                u" ".join(errors), current_step, data_idx + 1))      @classmethod      def wizard_post(cls, client, url, current_step, form_data=None, @@ -334,7 +334,7 @@ class WizardTest(object):              return          url = reverse(self.url_name)          self.pre_wizard() -        for test_form_data in self.form_datas: +        for data_idx, test_form_data in enumerate(self.form_datas):              test_form_data.inits(self)              form_data = test_form_data.form_datas              ignored = test_form_data.ignored @@ -353,9 +353,9 @@ class WizardTest(object):                  if current_step == test_form_data.error_expected:                      with self.assertRaises(ValidationError): -                        self.check_response(response, current_step) +                        self.check_response(response, current_step, data_idx)                  else: -                    self.check_response(response, current_step) +                    self.check_response(response, current_step, data_idx)                  if next_form_is_checked:                      next_form = self.steps[idx + 1][0] | 
