mirror of
https://github.com/django/django.git
synced 2025-07-24 13:44:32 +00:00
Removed custom profile model functionality as per deprecation TL.
This commit is contained in:
parent
5e08b792ef
commit
c196564132
9 changed files with 13 additions and 167 deletions
|
@ -3,9 +3,7 @@ from __future__ import absolute_import, unicode_literals
|
|||
import datetime
|
||||
import pickle
|
||||
from operator import attrgetter
|
||||
import warnings
|
||||
|
||||
from django.conf import settings
|
||||
from django.contrib.auth.models import User
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.core import management
|
||||
|
@ -1626,25 +1624,6 @@ class AuthTestCase(TestCase):
|
|||
command_output = new_io.getvalue().strip()
|
||||
self.assertTrue('"email": "alice@example.com"' in command_output)
|
||||
|
||||
|
||||
@override_settings(AUTH_PROFILE_MODULE='multiple_database.UserProfile')
|
||||
class UserProfileTestCase(TestCase):
|
||||
|
||||
def test_user_profiles(self):
|
||||
alice = User.objects.create_user('alice', 'alice@example.com')
|
||||
bob = User.objects.db_manager('other').create_user('bob', 'bob@example.com')
|
||||
|
||||
alice_profile = UserProfile(user=alice, flavor='chocolate')
|
||||
alice_profile.save()
|
||||
|
||||
bob_profile = UserProfile(user=bob, flavor='crunchy frog')
|
||||
bob_profile.save()
|
||||
|
||||
with warnings.catch_warnings():
|
||||
warnings.simplefilter("ignore", DeprecationWarning)
|
||||
self.assertEqual(alice.get_profile().flavor, 'chocolate')
|
||||
self.assertEqual(bob.get_profile().flavor, 'crunchy frog')
|
||||
|
||||
class AntiPetRouter(object):
|
||||
# A router that only expresses an opinion on syncdb,
|
||||
# passing pets to the 'other' database
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue