diff --git a/submissions/services.py b/submissions/services.py index 4448bea5c2a0d39b01afd1432be65eab797e5898..535d3cf8c98e5cea422e4e17019120266b6be4c9 100644 --- a/submissions/services.py +++ b/submissions/services.py @@ -1,9 +1,11 @@ # Module for making external api calls as needed in the submissions cycle -import feedparser, requests, pprint +import feedparser +import requests +import pprint +import re from io import BytesIO -from .models import * -import re +from .models import Submission class ArxivCaller(): diff --git a/submissions/test_views.py b/submissions/test_views.py index bbe7a83381558db12ee8652016b2cc032d57d846..5eef315b06ebc633dbb967284d7d0336a8073e17 100644 --- a/submissions/test_views.py +++ b/submissions/test_views.py @@ -1,8 +1,7 @@ from django.test import TestCase from django.test import Client -import pprint from submissions.views import * - +import django.core.urlresolvers class PrefillUsingIdentifierTest(TestCase): @@ -12,7 +11,7 @@ class PrefillUsingIdentifierTest(TestCase): client = Client() client.login(username="Test", password="testpw") - response = client.post('/submissions/prefill_using_identifier', + response = client.post(reverse('submissions:prefill_using_identifier'), {'identifier': '1512.00030v1'}) self.assertEqual(response.status_code, 200) @@ -21,7 +20,7 @@ class PrefillUsingIdentifierTest(TestCase): client = Client() client.login(username="Test", password="testpw") - response = client.post('/submissions/prefill_using_identifier', + response = client.post(reverse('submissions:prefill_using_identifier'), {'identifier': '1512.00030'}) self.assertEqual(response.status_code, 200) @@ -33,7 +32,7 @@ class SubmitManuscriptTest(TestCase): client = Client() client.login(username="Test", password="testpw") - response = client.post('/submissions/prefill_using_identifier', + response = client.post(reverse('submissions:prefill_using_identifier'), {'identifier': '1512.00030v1'}) params = response.context['form'].initial @@ -42,8 +41,7 @@ class SubmitManuscriptTest(TestCase): 'submitted_to_journal': 'SciPost Physics', 'submission_type': 'Article', 'domain': 'T'} - response = client.post('/submissions/submit_manuscript', + response = client.post(reverse('submissions:submit_manuscript'), {**params, **extras}) - pprint.pprint(params) self.assertEqual(response.status_code, 200)