コード例 #1
0
 def test_should_apply_async_in_send_email(self, apply_async_mock):
     name = 'name'
     from_address = 'from_address'
     to_address = 'to_address'
     subject = 'subject'
     tasks.start_send_email(name, from_address, to_address, subject)
     apply_async_mock.assert_called_with(
         (name, from_address, to_address, subject))
コード例 #2
0
ファイル: reception.py プロジェクト: PozziSan/manotes-api
 def create_user_account(cls, user):
     user['password'] = security_services.HashService.hash(user['password'])
     user['token'] = security_services.TokenService.generate()
     if not security_services.ValidationService.is_email(user['email']):
         raise exceptions.InvalidEmail(
             'Could not create user account because the email: {} is invalid'
             .format(user['email']))
     created_user = services.UserService.create_new(user)
     name = created_user.username
     from_address = "*****@*****.**"
     to_address = created_user.email
     subject = "Test"
     tasks.start_send_email(name, from_address, to_address, subject)
     return created_user
コード例 #3
0
 def test_should_return_task_id(self, apply_async_mock):
     task_mock = self.mock.MagicMock()
     task_mock.id = 1
     apply_async_mock.return_value = task_mock
     task_id = tasks.start_send_email('name', 'from_address', 'to_address',
                                      'subject')
     self.assertEqual(task_id, 1)
コード例 #4
0
 def __start_to_send_confirmation_email(self):
     name = self.__created_user.username
     from_address = "*****@*****.**"
     to_address = self.__created_user.email
     subject = "Test"
     tasks.start_send_email(name, from_address, to_address, subject)
コード例 #5
0
 def test_should_call_establish_logger_to_info(self, info_mock):
     tasks.start_send_email('name', 'from_address', 'to_address', 'subject')
     self.assertTrue(info_mock.called)