Skip to content

Commit

Permalink
Marked a test as an expected failure on Python 3.5+.
Browse files Browse the repository at this point in the history
An issue with circular references between Model objects prevent garbage
collection of tenant specific models on tenant deletion.
  • Loading branch information
charettes committed Dec 23, 2015
1 parent 68fbedd commit ad5fa4c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,9 @@ Create a tenant-specific model instance

tenant_project.objects.create("myfirsttenant_project")


Python 3.5
----------

An issue with circular references between ``Model`` objects prevent garbage
collection of tenant specific models on tenant deletion.
8 changes: 8 additions & 0 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
import gc
import logging
import pickle
import sys
import weakref
from itertools import chain
from unittest.case import expectedFailure

from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ImproperlyConfigured
Expand Down Expand Up @@ -101,6 +103,12 @@ def test_model_garbage_collection(self):
for model_wref in models_wrefs:
self.assertIsNone(model_wref())

if sys.version_info >= (3, 5):
# Models with relationships are not correctly garbage collected
# on Python 3.5. It looks like circular references between Model._meta,
# Options.model, Field.model and Manager.model might be the cause.
test_model_garbage_collection = expectedFailure(test_model_garbage_collection)


class TenantModelsDescriptorTest(TenancyTestCase):
def setUp(self):
Expand Down

0 comments on commit ad5fa4c

Please sign in to comment.