コード例 #1
0
ファイル: test_email.py プロジェクト: singuliere/edx-platform
    def test_always_rollback(self, _email_user):
        connection = transaction.get_connection()
        with patch.object(connection, 'rollback', wraps=connection.rollback) as mock_rollback:
            with self.assertRaises(TestException):
                confirm_email_change(self.request, self.key)

            mock_rollback.assert_called_with()
コード例 #2
0
ファイル: test_email.py プロジェクト: TeachAtTUM/edx-platform
    def test_always_rollback(self, _email_user):
        connection = transaction.get_connection()
        with patch.object(connection, 'rollback', wraps=connection.rollback) as mock_rollback:
            with self.assertRaises(TestException):
                confirm_email_change(self.request, self.key)

            mock_rollback.assert_called_with()
コード例 #3
0
ファイル: test_email.py プロジェクト: sigberto/edx-platform
    def check_confirm_email_change(self, expected_template, expected_context):
        """Call `confirm_email_change` and assert that the content was generated as expected

        `expected_template`: The name of the template that should have been used
            to generate the content
        `expected_context`: The context dictionary that should have been used to
            generate the content
        """
        response = confirm_email_change(self.request, self.key)
        self.assertEquals(mock_render_to_response(expected_template, expected_context).content, response.content)
コード例 #4
0
ファイル: test_email.py プロジェクト: iivic/BoiseStateX
    def check_confirm_email_change(self, expected_template, expected_context):
        """Call `confirm_email_change` and assert that the content was generated as expected

        `expected_template`: The name of the template that should have been used
            to generate the content
        `expected_context`: The context dictionary that should have been used to
            generate the content
        """
        response = confirm_email_change(self.request, self.key)
        self.assertEquals(
            mock_render_to_response(expected_template,
                                    expected_context).content,
            response.content)
コード例 #5
0
ファイル: test_email.py プロジェクト: CEIT-UQ/edx-platform
    def test_always_rollback(self, rollback, _email_user):
        with self.assertRaises(TestException):
            confirm_email_change(self.request, self.key)

        rollback.assert_called_with()
コード例 #6
0
ファイル: test_email.py プロジェクト: iivic/BoiseStateX
    def test_always_rollback(self, rollback, _email_user):
        with self.assertRaises(TestException):
            confirm_email_change(self.request, self.key)

        rollback.assert_called_with()