def test_prepare_email(self): utils.load_test_playgrounds() playground = Playground.get(id=1) log = '''[{ "field": "name", "from": "%s", "to": "Test Playground" }]''' % playground.name Revision(action='update', timestamp=time.mktime( datetime.datetime.now(pytz.utc).timetuple()), playground=playground, log=log, headers='', cookies='', revision_group=1).save() body = app._prepare_email(1) self.assertTrue(body.find(playground.name) >= 0)
def test_prepare_email(self): utils.load_test_playgrounds() playground = Playground.get(id=1) log = '''[{ "field": "name", "from": "%s", "to": "Test Playground" }]''' % playground.name Revision( action='update', timestamp=time.mktime(datetime.datetime.now(pytz.utc).timetuple()), playground=playground, log=log, headers='', cookies='', revision_group=1 ).save() body = app._prepare_email(1) self.assertTrue(body.find(playground.name) >= 0)
def send_revision_email(revision_group): payload = app._prepare_email(revision_group) addresses = app_config.ADMIN_EMAILS send_email(addresses, payload)