Beispiel #1
0
 def test_without_company(self):
     """
     Tests the get_raw_directory_path function when a Company is not given.
     """
     with patch.dict('sifter.mailsifter.attachments.settings.MAILSIFTER',
                     self.mock_mailsifter_settings):
         actual = attachments.get_raw_directory_path()
         expected = self.mock_mailsifter_settings['ATTACHMENTS_FOLDER']
         self.assertEqual(actual, expected)
Beispiel #2
0
 def test_with_company(self):
     """
     Tests the get_raw_directory_path function when a Company is given.
     """
     self.mock_mailsifter_settings['ATTACHMENTS_FOLDER'] = 'attachments/%Y/%m/%d/'
     with patch.dict('sifter.mailsifter.attachments.settings.MAILSIFTER',
                     self.mock_mailsifter_settings):
         actual = attachments.get_raw_directory_path(self.company)
         expected = '2d6f5a38306a40f3a5e14fc38a425531/'\
                    'attachments/%Y/%m/%d/'
         self.assertEqual(actual, expected)