コード例 #1
0
    def test_post_data(self):
        """EmailList.post() gathers post form data."""

        request = self.factory.post(self.url)
        view = setup_view(EmailLink(), request, self.post_data)
        resp = view.post(request)
        self.assertTrue('ok' in resp.content)
コード例 #2
0
ファイル: test_views.py プロジェクト: ielerol/college-costs
 def test_email_view(self, mock_send_mail, mock_get_template):
     request = self.factory.post(self.url, data=self.post_data)
     view = EmailLink.as_view()
     response = view(request)
     self.assertTrue(mock_send_mail.call_count == 1)
     self.assertTrue(mock_get_template.call_count == 1)
コード例 #3
0
 def test_email_view(self, mock_send_mail, mock_get_template):
     request = self.factory.post(self.url, data=self.post_data)
     view = EmailLink.as_view()
     response = view(request)
     self.assertTrue(mock_send_mail.call_count == 1)
     self.assertTrue(mock_get_template.call_count == 1)