fix(site-map): allow tab-separated survey files
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
0b04613ae1
commit
f06d545e02
2 changed files with 9 additions and 1 deletions
|
|
@ -53,7 +53,7 @@ def definitions(sites_id, models_id):
|
|||
"fields": [
|
||||
site, model,
|
||||
{"name": "file", "type": "file", "required": True, "maxSelect": 1, "maxSize": 1048576,
|
||||
"mimeTypes": ["text/csv", "text/plain", "application/vnd.ms-excel"], "protected": True},
|
||||
"mimeTypes": ["text/csv", "text/plain", "text/tab-separated-values", "application/vnd.ms-excel"], "protected": True},
|
||||
{"name": "matched", "type": "number", "required": False},
|
||||
{"name": "unmatched", "type": "json", "required": False, "maxSize": 200000},
|
||||
{"name": "user", "type": "text", "required": False, "max": 50},
|
||||
|
|
|
|||
|
|
@ -39,3 +39,11 @@ class SiteMapMigrationTests(unittest.TestCase):
|
|||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
|
||||
|
||||
class SurveyFileTypes(unittest.TestCase):
|
||||
def test_survey_file_accepts_tab_separated(self):
|
||||
defs = {d["name"]: d for d in migration.definitions("sites0", "models0")}
|
||||
f = next(x for x in defs["site_survey_imports"]["fields"] if x["name"] == "file")
|
||||
self.assertIn("text/tab-separated-values", f["mimeTypes"])
|
||||
|
|
|
|||
Loading…
Reference in a new issue