'Tests that even if password policy is enforced, ext_auth registrations aren\'t subject to it'

@override_settings(PASSWORD_MIN_LENGTH=6, SESSION_ENGINE='django.contrib.sessions.backends.cache')
def test_ext_auth_password_length_too_short(self):

    self.url_params['password'] = 'aaa'
    request = self.request_factory.post(self.url, self.url_params)
    request.site = SiteFactory.create()
    request.session = import_module(settings.SESSION_ENGINE).SessionStore()
    extauth = ExternalAuthMap(external_id='withmap@stanford.edu', external_email='withmap@stanford.edu', internal_password=self.url_params['password'], external_domain='shib:https://idp.stanford.edu/')
    request.session['ExternalAuthMap'] = extauth
    request.user = AnonymousUser()
    with patch('edxmako.request_context.get_current_request', return_value=request):
        response = create_account(request)
    self.assertEqual(response.status_code, 200)
    obj = json.loads(response.content)
    self.assertTrue(obj['success'])
