-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1283 from UUDigitalHumanitieslab/feature/csv-file…
…names Feature/csv filenames
- Loading branch information
Showing
9 changed files
with
55 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
import os | ||
from download import tasks | ||
from download.conftest import all_results_request_json | ||
from download.models import Download | ||
|
||
def test_format_route_to_filename(): | ||
route = '/search/mock-corpus;query=test' | ||
request_json = { 'route': route } | ||
output = tasks.create_query(request_json) | ||
assert output == 'mock-corpus_query=test' | ||
def test_download_filename(auth_user, small_mock_corpus, index_small_mock_corpus, small_mock_corpus_specs): | ||
request = all_results_request_json(small_mock_corpus, small_mock_corpus_specs) | ||
tasks.download_search_results(request, auth_user).apply() | ||
download = Download.objects.latest('completed') | ||
_, filename = os.path.split(download.filename) | ||
name, ext = os.path.splitext(filename) | ||
assert name == str(download.id) | ||
assert ext == '.csv' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters