Ejemplo n.º 1
0
 def test_enabled_apps_version_required(self):
     """Min/Max Version fields should be required for enabled apps."""
     forms = [self.compat_form, {'enabled': 'on'}]
     r = self.client.post(self.url, self._form_data(compat_forms=forms))
     assert_required(r.context['compat_forms'].errors[1]['min_ver'][0])
     assert_required(r.context['compat_forms'].errors[1]['max_ver'][0])
Ejemplo n.º 2
0
 def test_edit_categories_required(self):
     del self.cat_initial['categories']
     r = self.client.post(self.edit_url, formset(self.cat_initial,
                                                 initial_count=1))
     assert_required(r.context['cat_form'].errors[0]['categories'][0])
Ejemplo n.º 3
0
 def test_edit_categories_required(self):
     del self.cat_initial['categories']
     r = self.client.post(self.edit_url,
                          formset(self.cat_initial, initial_count=1))
     assert_required(r.context['cat_form'].errors[0]['categories'][0])
Ejemplo n.º 4
0
 def test_enabled_apps_version_required(self):
     """Min/Max Version fields should be required for enabled apps."""
     forms = [self.compat_form, {'enabled': 'on'}]
     r = self.client.post(self.url, self._form_data(compat_forms=forms))
     assert_required(r.context['compat_forms'].errors[1]['min_ver'][0])
     assert_required(r.context['compat_forms'].errors[1]['max_ver'][0])
Ejemplo n.º 5
0
 def test_edit_categories_required(self):
     r = self.client.post(self.edit_url, self.get_dict(categories=[]))
     assert_required(r.context['cat_form'].errors['categories'][0])
Ejemplo n.º 6
0
 def test_enabled_apps_version_required(self):
     """Min/Max Version fields should be required for enabled apps."""
     forms = [self.compat_form, {"enabled": "on"}]
     r = self.client.post(self.url, self._form_data(compat_forms=forms))
     assert_required(r.context["compat_forms"].errors[1]["min_ver"][0])
     assert_required(r.context["compat_forms"].errors[1]["max_ver"][0])