示例#1
0
    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]
        )
示例#2
0
    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])
示例#3
0
 def test_create_message(self):
     api.create_message(G(get_user_model()), INFO, "message")
示例#4
0
 def test_create_message(self):
     api.create_message(G(get_user_model()), INFO, 'message')
示例#5
0
 def test_create_message(self):
     api.create_message(
         G(get_user_model()), constants.INFO, 'message')