'A non-unique USERNAME_FIELD should raise a model validation error.'

@override_settings(AUTH_USER_MODEL=u'auth.CustomUserNonUniqueUsername')
def test_username_non_unique(self):

    new_io = StringIO()
    get_validation_errors(new_io, get_app(u'auth'))
    self.assertIn(u'The    USERNAME_FIELD    must    be    unique.    Add    unique=True    to    the    field    parameters.', new_io.getvalue())
