def make_random_username(): while True: username = random_string(max_length=25) try: User.objects.get(username__iexact=username) except User.DoesNotExist: return username
def _stub(*args, **kwargs): print "----- [stub] %s %s\n%s\n%s\n" % (name, "-" * (80 - len(name)), pprint.pformat(args), pprint.pformat(kwargs)) return { "stub": True, "id": random_string() }