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