def test_new_user_confirm(self, monkeypatch): AccountProcessor.add_user( email="*****@*****.**", first_name="inteq", last_name="2", password='******', account=1, bot=pytest.bot, user="******", ) monkeypatch.setattr(Utility, 'trigger_smtp', self.mock_smtp) token = Utility.generate_token('*****@*****.**') loop = asyncio.new_event_loop() loop.run_until_complete(AccountProcessor.confirm_email(token)) assert True
def test_user_already_confirmed(self, monkeypatch): monkeypatch.setattr(Utility, 'trigger_smtp', self.mock_smtp) loop = asyncio.new_event_loop() token = Utility.generate_token('*****@*****.**') with pytest.raises(Exception): loop.run_until_complete(AccountProcessor.confirm_email(token))