diff --git a/opentech/apply/determinations/tests/test_views.py b/opentech/apply/determinations/tests/test_views.py index 6632d606b611b70b80c83b63d62bf2be500e1842..a09bfbebdfe94a67ca7ad2f893e0c87c5d7fa37b 100644 --- a/opentech/apply/determinations/tests/test_views.py +++ b/opentech/apply/determinations/tests/test_views.py @@ -6,7 +6,7 @@ from django.test import override_settings, RequestFactory from django.urls import reverse_lazy from opentech.apply.activity.models import Activity -from opentech.apply.determinations.models import ACCEPTED, REJECTED +from opentech.apply.determinations.models import ACCEPTED, REJECTED, NEEDS_MORE_INFO from opentech.apply.determinations.views import BatchDeterminationCreateView from opentech.apply.users.tests.factories import StaffFactory, UserFactory from opentech.apply.funds.models import ApplicationSubmission @@ -361,6 +361,28 @@ class BatchDeterminationTestCase(BaseViewTestCase): self.assertRedirects(response, self.url_from_pattern('apply:submissions:list')) + def test_can_submit_batch_determination_more_info_comment(self): + submissions = ApplicationSubmissionFactory.create_batch(4) + + url = self.url(None) + '?submissions=' + ','.join([str(submission.id) for submission in submissions]) + '&action=more_info' + data = { + 'submissions': [submission.id for submission in submissions], + 'data': 'some data', + 'outcome': NEEDS_MORE_INFO, + 'message': 'More Info', + 'author': self.user.id, + } + + response = self.client.post(url, data, secure=True, follow=True) + + for submission in submissions: + submission = self.refresh(submission) + self.assertEqual(submission.status, 'more_info') + self.assertEqual(submission.determinations.count(), 1) + self.assertEqual(submission.activities.comments().count(), 1) + + self.assertRedirects(response, self.url_from_pattern('apply:submissions:list')) + def test_sets_next_on_redirect(self): test_path = '/a/path/?with=query&a=sting' request = RequestFactory().get('', PATH_INFO=test_path) diff --git a/opentech/settings/base.py b/opentech/settings/base.py index 7a203609544830429202a6f20bcf0c19e500f14a..0aebe1efce6d9f484565bc6ea109210618b4c61d 100644 --- a/opentech/settings/base.py +++ b/opentech/settings/base.py @@ -325,7 +325,7 @@ SHORT_DATETIME_FORMAT = 'Y-m-d\TH:i:s' # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/stable/howto/static-files/ -STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage' +STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' STATICFILES_DIRS = [ os.path.join(PROJECT_DIR, 'static_compiled'),