From 3b4aba6f6777c3a0df1acca693dbd30ce48c3368 Mon Sep 17 00:00:00 2001
From: Todd Dembrey <todd.dembrey@torchbox.com>
Date: Fri, 3 Aug 2018 11:55:28 +0100
Subject: [PATCH] Add a test to explicitly test if the action is logged

---
 opentech/apply/funds/tests/test_views.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/opentech/apply/funds/tests/test_views.py b/opentech/apply/funds/tests/test_views.py
index 039e0e929..f04a457b4 100644
--- a/opentech/apply/funds/tests/test_views.py
+++ b/opentech/apply/funds/tests/test_views.py
@@ -1,5 +1,6 @@
 from datetime import datetime, timedelta
 
+from opentech.apply.activity.models import Activity
 from opentech.apply.funds.tests.factories import (
     ApplicationSubmissionFactory,
     ApplicationRevisionFactory,
@@ -253,8 +254,15 @@ class TestSuperUserSealedView(BaseSubmissionViewTestCase):
         response = self.post_page(submission, {}, 'sealed')
         url = self.url_from_pattern('funds:submissions:detail', kwargs={'pk': submission.id})
         self.assertRedirects(response, url)
+
+    def test_peeking_is_logged(self):
+        submission = SealedSubmissionFactory()
+        self.post_page(submission, {}, 'sealed')
+
         self.assertTrue('peeked' in self.client.session)
         self.assertTrue(str(submission.id) in self.client.session['peeked'])
+        self.assertEqual(Activity.objects.count(), 1)
+        self.assertTrue('sealed' in Activity.objects.first().message)
 
     def test_not_asked_again(self):
         submission = SealedSubmissionFactory()
-- 
GitLab