mirror of
https://github.com/Hopiu/django-model-utils.git
synced 2026-03-16 20:00:23 +00:00
parent
4d5969a616
commit
10ebc16271
25 changed files with 28 additions and 33 deletions
|
|
@ -5,11 +5,10 @@ import os, sys
|
|||
from django.conf import settings
|
||||
import django
|
||||
|
||||
|
||||
DEFAULT_SETTINGS = dict(
|
||||
INSTALLED_APPS=(
|
||||
'model_utils',
|
||||
'model_utils.tests',
|
||||
'tests',
|
||||
),
|
||||
DATABASES={
|
||||
"default": {
|
||||
|
|
@ -17,7 +16,7 @@ DEFAULT_SETTINGS = dict(
|
|||
}
|
||||
},
|
||||
SILENCED_SYSTEM_CHECKS=["1_7.W001"],
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def runtests():
|
||||
|
|
@ -31,7 +30,7 @@ def runtests():
|
|||
|
||||
from django.test.runner import DiscoverRunner
|
||||
runner_class = DiscoverRunner
|
||||
test_args = ['model_utils.tests']
|
||||
test_args = ['tests']
|
||||
|
||||
failures = runner_class(
|
||||
verbosity=1, interactive=True, failfast=False).run_tests(test_args)
|
||||
|
|
|
|||
4
setup.py
4
setup.py
|
|
@ -30,7 +30,7 @@ setup(
|
|||
author='Carl Meyer',
|
||||
author_email='carl@oddbird.net',
|
||||
url='https://github.com/carljm/django-model-utils/',
|
||||
packages=find_packages(),
|
||||
packages=find_packages(exclude=['tests*']),
|
||||
install_requires=['Django>=1.8'],
|
||||
classifiers=[
|
||||
'Development Status :: 5 - Production/Stable',
|
||||
|
|
@ -39,7 +39,6 @@ setup(
|
|||
'License :: OSI Approved :: BSD License',
|
||||
'Operating System :: OS Independent',
|
||||
'Programming Language :: Python',
|
||||
'Programming Language :: Python :: 2.6',
|
||||
'Programming Language :: Python :: 2.7',
|
||||
'Programming Language :: Python :: 3',
|
||||
'Programming Language :: Python :: 3.3',
|
||||
|
|
@ -49,7 +48,6 @@ setup(
|
|||
],
|
||||
zip_safe=False,
|
||||
tests_require=['Django>=1.8'],
|
||||
test_suite='runtests.runtests',
|
||||
package_data={
|
||||
'model_utils': [
|
||||
'locale/*/LC_MESSAGES/django.po','locale/*/LC_MESSAGES/django.mo'
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from __future__ import unicode_literals
|
||||
from __future__ import unicode_literals, absolute_import
|
||||
|
||||
from django.db import models
|
||||
from django.db.models import Manager
|
||||
|
|
@ -14,8 +14,8 @@ from model_utils.models import (
|
|||
TimeFramedModel,
|
||||
TimeStampedModel,
|
||||
)
|
||||
from model_utils.tests.fields import MutableField
|
||||
from model_utils.tests.managers import CustomSoftDeleteManager
|
||||
from tests.fields import MutableField
|
||||
from tests.managers import CustomSoftDeleteManager
|
||||
from model_utils.tracker import FieldTracker, ModelTracker
|
||||
|
||||
|
||||
|
|
@ -7,7 +7,7 @@ from django.core.exceptions import FieldError
|
|||
from django.test import TestCase
|
||||
|
||||
from model_utils import FieldTracker
|
||||
from model_utils.tests.models import (
|
||||
from tests.models import (
|
||||
Tracked, TrackedFK, InheritedTrackedFK, TrackedNotDefault, TrackedNonFieldAttr, TrackedMultiple,
|
||||
InheritedTracked, TrackedFileField,
|
||||
ModelTracked, ModelTrackedFK, ModelTrackedNotDefault, ModelTrackedMultiple, InheritedModelTracked,
|
||||
|
|
@ -7,7 +7,7 @@ from freezegun import freeze_time
|
|||
from django.test import TestCase
|
||||
|
||||
from model_utils.fields import MonitorField
|
||||
from model_utils.tests.models import Monitored, MonitorWhen, MonitorWhenEmpty, DoubleMonitored
|
||||
from tests.models import Monitored, MonitorWhen, MonitorWhenEmpty, DoubleMonitored
|
||||
|
||||
|
||||
class MonitorFieldTests(TestCase):
|
||||
|
|
@ -3,7 +3,7 @@ from __future__ import unicode_literals
|
|||
from django.utils.six import text_type
|
||||
from django.test import TestCase
|
||||
|
||||
from model_utils.tests.models import Article, SplitFieldAbstractParent
|
||||
from tests.models import Article, SplitFieldAbstractParent
|
||||
|
||||
|
||||
class SplitFieldTests(TestCase):
|
||||
|
|
@ -3,7 +3,7 @@ from __future__ import unicode_literals
|
|||
from django.test import TestCase
|
||||
|
||||
from model_utils.fields import StatusField
|
||||
from model_utils.tests.models import (
|
||||
from tests.models import (
|
||||
Article, StatusFieldDefaultFilled, StatusFieldDefaultNotFilled,
|
||||
StatusFieldChoicesName,
|
||||
)
|
||||
|
|
@ -6,7 +6,7 @@ import django
|
|||
from django.db import models
|
||||
from django.test import TestCase
|
||||
|
||||
from model_utils.tests.models import (InheritanceManagerTestRelated, InheritanceManagerTestGrandChild1,
|
||||
from tests.models import (InheritanceManagerTestRelated, InheritanceManagerTestGrandChild1,
|
||||
InheritanceManagerTestGrandChild1_2, InheritanceManagerTestParent,
|
||||
InheritanceManagerTestChild1,
|
||||
InheritanceManagerTestChild2, TimeFrame, InheritanceManagerTestChild3
|
||||
|
|
@ -2,7 +2,7 @@ from __future__ import unicode_literals
|
|||
|
||||
from django.test import TestCase
|
||||
|
||||
from model_utils.tests.models import Post
|
||||
from tests.models import Post
|
||||
|
||||
|
||||
class QueryManagerTests(TestCase):
|
||||
|
|
@ -2,7 +2,7 @@ from __future__ import unicode_literals
|
|||
|
||||
from django.test import TestCase
|
||||
|
||||
from model_utils.tests.models import CustomSoftDelete
|
||||
from tests.models import CustomSoftDelete
|
||||
|
||||
|
||||
class CustomSoftDeleteManagerTests(TestCase):
|
||||
|
|
@ -6,7 +6,7 @@ from django.test import TestCase
|
|||
|
||||
from model_utils.managers import QueryManager
|
||||
from model_utils.models import StatusModel
|
||||
from model_utils.tests.models import StatusManagerAdded
|
||||
from tests.models import StatusManagerAdded
|
||||
|
||||
|
||||
class StatusManagerAddedTests(TestCase):
|
||||
|
|
@ -3,7 +3,7 @@ from __future__ import unicode_literals
|
|||
from django.db.utils import ConnectionDoesNotExist
|
||||
from django.test import TestCase
|
||||
|
||||
from model_utils.tests.models import SoftDeletable
|
||||
from tests.models import SoftDeletable
|
||||
|
||||
|
||||
class SoftDeletableModelTests(TestCase):
|
||||
|
|
@ -4,7 +4,7 @@ from freezegun import freeze_time
|
|||
|
||||
from django.test.testcases import TestCase
|
||||
|
||||
from model_utils.tests.models import Status, StatusPlainTuple, StatusCustomManager
|
||||
from tests.models import Status, StatusPlainTuple, StatusCustomManager
|
||||
|
||||
|
||||
class StatusModelTests(TestCase):
|
||||
|
|
@ -8,7 +8,7 @@ from django.test import TestCase
|
|||
|
||||
from model_utils.managers import QueryManager
|
||||
from model_utils.models import TimeFramedModel
|
||||
from model_utils.tests.models import TimeFrame, TimeFrameManagerAdded
|
||||
from tests.models import TimeFrame, TimeFrameManagerAdded
|
||||
|
||||
|
||||
class TimeFramedModelTests(TestCase):
|
||||
|
|
@ -6,7 +6,7 @@ from freezegun import freeze_time
|
|||
|
||||
from django.test import TestCase
|
||||
|
||||
from model_utils.tests.models import TimeStamp
|
||||
from tests.models import TimeStamp
|
||||
|
||||
|
||||
class TimeStampedModelTests(TestCase):
|
||||
2
tox.ini
2
tox.ini
|
|
@ -20,4 +20,4 @@ deps =
|
|||
django_trunk: https://github.com/django/django/tarball/master
|
||||
freezegun == 0.3.8
|
||||
|
||||
commands = coverage run -a setup.py test
|
||||
commands = coverage run runtests.py
|
||||
|
|
|
|||
|
|
@ -1,16 +1,14 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
from django.conf import settings
|
||||
import django
|
||||
|
||||
|
||||
DEFAULT_SETTINGS = dict(
|
||||
INSTALLED_APPS=(
|
||||
'model_utils',
|
||||
'model_utils.tests',
|
||||
'tests',
|
||||
),
|
||||
DATABASES={
|
||||
"default": {
|
||||
|
|
@ -18,7 +16,7 @@ DEFAULT_SETTINGS = dict(
|
|||
}
|
||||
},
|
||||
SILENCED_SYSTEM_CHECKS=["1_7.W001"],
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def run(command):
|
||||
|
|
|
|||
Loading…
Reference in a new issue