mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Merged regressiontests and modeltests into the test root.
This commit is contained in:
parent
b3d2ccb5bf
commit
89f40e3624
1050 changed files with 0 additions and 0 deletions
23
tests/base/models.py
Normal file
23
tests/base/models.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models
|
||||
from django.utils import six
|
||||
|
||||
|
||||
# The models definitions below used to crash. Generating models dynamically
|
||||
# at runtime is a bad idea because it pollutes the app cache. This doesn't
|
||||
# integrate well with the test suite but at least it prevents regressions.
|
||||
|
||||
|
||||
class CustomBaseModel(models.base.ModelBase):
|
||||
pass
|
||||
|
||||
|
||||
class MyModel(six.with_metaclass(CustomBaseModel, models.Model)):
|
||||
"""Model subclass with a custom base using six.with_metaclass."""
|
||||
|
||||
|
||||
if not six.PY3:
|
||||
class MyModel(models.Model):
|
||||
"""Model subclass with a custom base using __metaclass__."""
|
||||
__metaclass__ = CustomBaseModel
|
Loading…
Add table
Add a link
Reference in a new issue