コード例 #1
0
    def generate_password(self):
        """Generate password, set :py:attr:`password` and return clear value.

        Uses ``settings.TICKETOFFICE_PASSWORD_GENERATOR``.

        Does not save the instance.

        """
        import_path, args, kwargs = settings.TICKETOFFICE_PASSWORD_GENERATOR
        generator = import_member(import_path)
        clear_password = generator(*args, **kwargs)
        self.set_password(clear_password)
        return clear_password
コード例 #2
0
 def test_password_generator_default(self):
     "django_ticketoffice.settings.TICKETOFFICE_PASSWORD_GENERATOR works."
     import_path, args, kwargs = TICKETOFFICE_PASSWORD_GENERATOR
     generator = utils.import_member(import_path)
     password = generator(args, kwargs)
     self.assertTrue(password)
コード例 #3
0
 def test_password_generator_default(self):
     "django_ticketoffice.settings.TICKETOFFICE_PASSWORD_GENERATOR works."
     import_path, args, kwargs = TICKETOFFICE_PASSWORD_GENERATOR
     generator = utils.import_member(import_path)
     password = generator(args, kwargs)
     self.assertTrue(password)