1
0
mirror of https://github.com/django/django.git synced 2025-10-25 14:46:09 +00:00

[1.8.x] Fixed #24328 -- cleaned up Options._get_fields() implementation

Backport of bad5f262bf from master
This commit is contained in:
Anssi Kääriäinen
2015-02-16 09:49:19 +02:00
committed by Tim Graham
parent 3a6c37fce4
commit 6f03a4ca91
5 changed files with 106 additions and 105 deletions

View File

@@ -3,7 +3,7 @@ from __future__ import unicode_literals
from django.apps import apps
from django.contrib import admin
from django.contrib.contenttypes.models import ContentType
from django.core import checks, management
from django.core import checks, exceptions, management
from django.db import DEFAULT_DB_ALIAS, models
from django.db.models import signals
from django.test import TestCase, override_settings
@@ -327,8 +327,18 @@ class ProxyModelTests(TestCase):
resp = StateProxy.objects.select_related().get(name='New South Wales')
self.assertEqual(resp.name, 'New South Wales')
def test_filter_proxy_relation_reverse(self):
tu = TrackerUser.objects.create(
name='Contributor', status='contrib')
with self.assertRaises(exceptions.FieldError):
TrackerUser.objects.filter(issue=None),
self.assertQuerysetEqual(
ProxyTrackerUser.objects.filter(issue=None),
[tu], lambda x: x
)
def test_proxy_bug(self):
contributor = TrackerUser.objects.create(name='Contributor',
contributor = ProxyTrackerUser.objects.create(name='Contributor',
status='contrib')
someone = BaseUser.objects.create(name='Someone')
Bug.objects.create(summary='fix this', version='1.1beta',