def testWeirdCharactersInHookText(self): program = ProgramFactory() self.config.program_hooks = '%s:+:[{])(%%' % program.uuid self.config.save() call_command('modify_program_hooks') program.refresh_from_db() self.assertEqual(program.marketing_hook, '+:[{])(%')
def testNormalRun(self): program = ProgramFactory() program1 = ProgramFactory() self.config.program_hooks = '''{uuid}:Bananas in pajamas {uuid1}:Are coming down the stairs'''.format(uuid=program.uuid, uuid1=program1.uuid) self.config.save() call_command('modify_program_hooks') program.refresh_from_db() program1.refresh_from_db() self.assertEqual(program.marketing_hook, 'Bananas in pajamas') self.assertEqual(program1.marketing_hook, 'Are coming down the stairs')