Skip to content

Commit

Permalink
Update 'test_uniqueness_of_group_names_enforced' test
Browse files Browse the repository at this point in the history
Update the test and add a docstring explaining when the error occurs
  • Loading branch information
DavisRayM committed Mar 27, 2020
1 parent 3e93a3c commit f45ab96
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Binary file not shown.
Binary file not shown.
11 changes: 9 additions & 2 deletions onadata/apps/main/tests/test_past_bugs.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,20 @@ class TestInputs(TestBase):
"""

def test_uniqueness_of_group_names_enforced(self):
"""
Test an error is raised when a form containing a group
with the name "data" is present within the form.
This error is raised due to the fact that the root node
is named "data"
"""
pre_count = XForm.objects.count()
self._create_user_and_login()
self.assertRaisesMessage(
PyXFormError,
"There are two sections with the name group_names_must_be_unique.",
"There are two sections with the name data.",
self._publish_xls_file,
'fixtures/group_names_must_be_unique.xls')
'fixtures/group_names_must_be_unique.xlsx')
self.assertEqual(XForm.objects.count(), pre_count)

def test_mch(self):
Expand Down

0 comments on commit f45ab96

Please sign in to comment.