<s> from django . conf import settings <EOL> from django . contrib . auth . models import SiteProfileNotAvailable <EOL> from django . core . exceptions import ImproperlyConfigured <EOL> from django . db . models import get_model <EOL> from django . test import TestCase <EOL> from django . test . utils import override_settings <EOL> from userprofiles import forms <EOL> from userprofiles import utils <EOL> class UtilsTests ( TestCase ) : <EOL> def test_get_profile_module_disabled ( self ) : <EOL> self . assertEqual ( utils . get_profile_model ( ) , None ) <EOL> @ override_settings ( USERPROFILES_USE_PROFILE = True ) <EOL> def test_get_profile_module_enabled ( self ) : <EOL> settings . AUTH_PROFILE_MODULE = None <EOL> self . assertRaises ( SiteProfileNotAvailable , utils . get_profile_model ) <EOL> settings . AUTH_PROFILE_MODULE = '<STR_LIT>' <EOL> self . assertRaises ( SiteProfileNotAvailable , utils . get_profile_model ) <EOL> settings . AUTH_PROFILE_MODULE = '<STR_LIT>' <EOL> self . assertRaises ( SiteProfileNotAvailable , utils . get_profile_model ) <EOL> settings . AUTH_PROFILE_MODULE = '<STR_LIT>' <EOL> self . assertEqual ( utils . get_profile_model ( ) , get_model ( '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> def test_get_form_class ( self ) : <EOL> self . assertEqual ( utils . get_form_class ( '<STR_LIT>' ) , <EOL> forms . RegistrationForm ) <EOL> self . assertRaises ( ImproperlyConfigured , <EOL> utils . get_form_class , '<STR_LIT>' ) <EOL> self . assertRaises ( ImproperlyConfigured , <EOL> utils . get_form_class , '<STR_LIT>' ) </s>
