def handle(self, *args, **options): try: from_user, to_user = [get_user(username) for username in args[:2]] except ValueError: err(self.help) message = " ".join(args[3:]) level = getattr(api.constants, args[2]) api.create_message( level=level, from_user=from_user, to_user=to_user, message=message, subject="%s message" % args[2] )
def handle(self, *args, **options): try: from_user, to_user = [get_user(username) for username in args[:2]] except ValueError: err(self.help) message = " ".join(args[3:]) level = getattr(api.constants, args[2]) api.create_message(level=level, from_user=from_user, to_user=to_user, message=message, subject="%s message" % args[2])
def test_create_message(self): api.create_message(G(get_user_model()), INFO, "message")
def test_create_message(self): api.create_message(G(get_user_model()), INFO, 'message')
def test_create_message(self): api.create_message( G(get_user_model()), constants.INFO, 'message')