Ticket #14948: 14948-1.2.X-r15186.diff

File 14948-1.2.X-r15186.diff, 1.2 KB (added by Ramiro Morales, 14 years ago)

Patch by Harm Geerts updated to 1.2.x banch status as of now

  • tests/regressiontests/multiple_database/tests.py

    diff --git a/tests/regressiontests/multiple_database/tests.py b/tests/regressiontests/multiple_database/tests.py
    a b  
    11import datetime
    22import pickle
    3 import sys
    43from StringIO import StringIO
    54
    65from django.conf import settings
    7 from django.contrib.auth.models import User
     6from django.contrib.auth.models import User, Group
    87from django.core import management
    98from django.db import connections, router, DEFAULT_DB_ALIAS
    10 from django.db.utils import ConnectionRouter
    119from django.test import TestCase
    1210
    1311from models import Book, Person, Pet, Review, UserProfile
     
    15751573        command_output = new_io.getvalue().strip()
    15761574        self.assertTrue('"email": "alice@example.com",' in command_output)
    15771575
     1576    def test_related_accessor(self):
     1577        "Check that related accessors validate the through model"
     1578        user = User.objects.create_user('alice', 'alice@example.com')
     1579        group = Group.objects.create(name='Users')
     1580        user.groups = [group]
     1581        self.assertEquals(Group.objects.using('other').filter(user=user).count(), 1)
     1582
    15781583_missing = object()
    15791584class UserProfileTestCase(TestCase):
    15801585    def setUp(self):
Back to Top