Code Duplication    Length = 11-11 lines in 2 locations

tests/test_email.py 2 locations

@@ 67-77 (lines=11) @@
64
            self.assertIn('CC', content)
65
            self.assertIn('galatic-empire', content)
66
67
    def test_sendmail_bcc(self):
68
        with patch('oe_utils.email.smtp.SMTPClient.smtp_obj') as smtp_mock:
69
            smtp_mock.__get__ = Mock(return_value=self.smtp_obj_mock)
70
            email_engine = SMTPClient('smtp', '[email protected]')
71
            email_engine.send_mail(['[email protected]'], 'test subject', self.email_content,
72
                                   bcc=['[email protected]'])
73
            self.assertEqual(self.smtp_obj_mock.sendmail.call_count, 1)
74
            content = self.smtp_obj_mock.sendmail.mock_calls[0][1][2]
75
            self.smtp_obj_mock.sendmail.assert_called_once_with('[email protected]',
76
                                                                ['[email protected]', '[email protected]'], ANY)
77
            self.assertIn('BCC', content)
78
            self.assertIn('galatic-empire', content)
79
80
    def test_sendmail_attachment(self):
@@ 54-64 (lines=11) @@
51
            self.assertRaises(Exception, email_engine.send_mail, ['[email protected]'], 'test subject', self.email_content)
52
            self.assertEqual(smtp_obj_mock2.sendmail.call_count, 1)
53
54
    def test_sendmail_cc(self):
55
        with patch('oe_utils.email.smtp.SMTPClient.smtp_obj') as smtp_mock:
56
            smtp_mock.__get__ = Mock(return_value=self.smtp_obj_mock)
57
            email_engine = SMTPClient('smtp', '[email protected]')
58
            email_engine.send_mail(['[email protected]'], 'test subject', self.email_content,
59
                                   cc=['[email protected]'])
60
            self.assertEqual(self.smtp_obj_mock.sendmail.call_count, 1)
61
            content = self.smtp_obj_mock.sendmail.mock_calls[0][1][2]
62
            self.smtp_obj_mock.sendmail.assert_called_once_with('[email protected]',
63
                                                                ['[email protected]', '[email protected]'], ANY)
64
            self.assertIn('CC', content)
65
            self.assertIn('galatic-empire', content)
66
67
    def test_sendmail_bcc(self):