Example #1
0
    def _add_password_field(self, form_desc, required=True):
        """Add a password field to a form description.
        Arguments:
            form_desc: A form description
        Keyword Arguments:
            required (bool): Whether this field is required; defaults to True
        """
        # Translators: This label appears above a field on the registration form
        # meant to hold the user's password.
        password_label = _(u"Password")

        form_desc.add_field(
            "password",
            label=password_label,
            field_type="password",
            instructions=password_validators_instruction_texts(),
            restrictions=password_validators_restrictions(),
            required=required)
Example #2
0
    def _add_password_field(self, form_desc, required=True):
        """Add a password field to a form description.
        Arguments:
            form_desc: A form description
        Keyword Arguments:
            required (bool): Whether this field is required; defaults to True
        """
        # Translators: This label appears above a field on the registration form
        # meant to hold the user's password.
        password_label = _(u"Password")

        form_desc.add_field(
            "password",
            label=password_label,
            field_type="password",
            instructions=password_validators_instruction_texts(),
            restrictions=password_validators_restrictions(),
            required=required
        )
 def test_password_instructions(self, config, msg):
     """ Tests password instructions """
     with override_settings(AUTH_PASSWORD_VALIDATORS=config):
         self.assertIn(msg, password_validators_instruction_texts())
 def test_password_instructions(self, config, msg):
     """ Tests password instructions """
     with override_settings(AUTH_PASSWORD_VALIDATORS=config):
         self.assertIn(msg, password_validators_instruction_texts())