diff options
Diffstat (limited to 'ishtar_common/tests.py')
| -rw-r--r-- | ishtar_common/tests.py | 25 | 
1 files changed, 22 insertions, 3 deletions
| diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py index 6db425cab..f22e42e38 100644 --- a/ishtar_common/tests.py +++ b/ishtar_common/tests.py @@ -176,15 +176,21 @@ class WizardTest(object):                  }                  if current_step in form_data:                      d = form_data[current_step] -                    for k in d: -                        data['{}-{}'.format(current_step, k)] = d[k] +                    if type(d) in (list, tuple):  # formset +                        for d_idx, item in enumerate(d): +                            for k in item: +                                data['{}-{}-{}'.format( +                                    current_step, d_idx, k)] = item[k] +                    else: +                        for k in d: +                            data['{}-{}'.format(current_step, k)] = d[k]                  next_idx, next_form = idx + 1, None                  while len(self.steps) > next_idx:                      if self.steps[idx + 1][0] not in ignored:                          next_form = self.steps[idx + 1][0]                          break -                    next_idx = next_idx + 1 +                    next_idx += 1                  if next_form:                      try:                          response = self.client.post(url, data) @@ -440,3 +446,16 @@ class IshtarSiteProfileTest(TestCase):          p.raw_name = ''          p.save()          self.assertEqual(p.raw_name, u"tegada plouf") + + +class IshtarBasicTest(TestCase): +    def setUp(self): +        password = 'mypassword' +        my_admin = User.objects.create_superuser( +            'myuser', 'myemail@test.com', password) +        self.client = Client() +        self.client.login(username=my_admin.username, password=password) + +    def test_status(self): +        response = self.client.get(reverse('status')) +        self.assertEqual(response.status_code, 200) | 
