Skip to content

Commit

Permalink
rid formList.xml of optional fields (manifestUrl)
Browse files Browse the repository at this point in the history
Update tests

Signed-off-by: Lincoln Simba <[email protected]>
  • Loading branch information
lincmba committed Jan 21, 2019
1 parent 8ac18a5 commit e538557
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion onadata/apps/api/tests/fixtures/formList.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<xforms xmlns="http://openrosa.org/xforms/xformsList"><xform><formID>transportation_2011_07_25</formID><name>transportation_2011_07_25</name><version>2014111</version><hash>%(hash)s</hash><descriptionText></descriptionText><downloadUrl>http://testserver/bob/forms/%(pk)s/form.xml</downloadUrl><manifestUrl></manifestUrl></xform></xforms>
<xforms xmlns="http://openrosa.org/xforms/xformsList"><xform><formID>transportation_2011_07_25</formID><name>transportation_2011_07_25</name><version>2014111</version><hash>%(hash)s</hash><descriptionText></descriptionText><downloadUrl>http://testserver/bob/forms/%(pk)s/form.xml</downloadUrl></xform></xforms>
17 changes: 8 additions & 9 deletions onadata/apps/main/tests/test_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
import json
import os
import re
import pytz
from builtins import open
from datetime import datetime
from future.utils import iteritems
from hashlib import md5
from mock import patch
from xml.dom import minidom, Node

from django.core.urlresolvers import reverse
import pytz
from builtins import open
from django.conf import settings
from django_digest.test import Client as DigestClient
from django.core.files.uploadedfile import UploadedFile
from django.core.urlresolvers import reverse
from django_digest.test import Client as DigestClient
from future.utils import iteritems
from mock import patch
from xlrd import open_workbook
from xml.dom import minidom, Node

from onadata.apps.logger.models import XForm
from onadata.apps.logger.models.xform import XFORM_TITLE_LENGTH
Expand All @@ -26,7 +26,6 @@
from onadata.libs.utils.common_tags import MONGO_STRFTIME
from onadata.libs.utils.common_tools import get_response_content


uuid_regex = re.compile(
r'(</instance>.*uuid[^//]+="\')([^\']+)(\'".*)', re.DOTALL)

Expand Down Expand Up @@ -217,7 +216,7 @@ def _check_formlist(self):
% (self.user.username, self.xform.pk)
md5_hash = md5(self.xform.xml.encode('utf-8')).hexdigest()
expected_content = """<?xml version="1.0" encoding="utf-8"?>
<xforms xmlns="http://openrosa.org/xforms/xformsList"><xform><formID>transportation_2011_07_25</formID><name>transportation_2011_07_25</name><version>2014111</version><hash>md5:%(hash)s</hash><descriptionText></descriptionText><downloadUrl>%(download_url)s</downloadUrl><manifestUrl></manifestUrl></xform></xforms>""" # noqa
<xforms xmlns="http://openrosa.org/xforms/xformsList"><xform><formID>transportation_2011_07_25</formID><name>transportation_2011_07_25</name><version>2014111</version><hash>md5:%(hash)s</hash><descriptionText></descriptionText><downloadUrl>%(download_url)s</downloadUrl></xform></xforms>""" # noqa
expected_content = expected_content % {
'download_url': self.download_url,
'hash': md5_hash
Expand Down

0 comments on commit e538557

Please sign in to comment.