コード例 #1
0
 def test_send_confirmation_link_with_invalid_id(self, monkeypatch):
     AccountProcessor.EMAIL_ENABLED = True
     monkeypatch.setattr(Utility, 'trigger_smtp', self.mock_smtp)
     loop = asyncio.new_event_loop()
     with pytest.raises(Exception):
         loop.run_until_complete(
             AccountProcessor.send_confirmation_link(''))
     AccountProcessor.EMAIL_ENABLED = False
コード例 #2
0
 def test_send_confirmation_link_with_valid_id(self, monkeypatch):
     AccountProcessor.add_user(
         email="*****@*****.**",
         first_name="inteq",
         last_name="3",
         password='******',
         account=1,
         bot=pytest.bot,
         user="******",
     )
     AccountProcessor.EMAIL_ENABLED = True
     monkeypatch.setattr(Utility, 'trigger_smtp', self.mock_smtp)
     loop = asyncio.new_event_loop()
     loop.run_until_complete(
         AccountProcessor.send_confirmation_link('*****@*****.**'))
     AccountProcessor.EMAIL_ENABLED = False
     assert True
コード例 #3
0
 def test_send_confirmation_link_with_mail_not_enabled(self, monkeypatch):
     monkeypatch.setattr(Utility, 'trigger_smtp', self.mock_smtp)
     loop = asyncio.new_event_loop()
     with pytest.raises(Exception):
         loop.run_until_complete(
             AccountProcessor.send_confirmation_link('*****@*****.**'))