File tree 4 files changed +41
-0
lines changed
4 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -16,3 +16,10 @@ Add this to the top of any template:
16
16
And drop the filter anywhere you have a model instance (e.g., DetailViews):
17
17
18
18
{{ object|as_detail_html }}
19
+
20
+ Running Tests
21
+ -------------
22
+
23
+ $ python tests.py --with-coverage --cover-package=model_filters
24
+
25
+ Run it before and after you make any changes. Try to not let that number drop.
Original file line number Diff line number Diff line change 117
117
'django.contrib.staticfiles' ,
118
118
'django.contrib.admin' ,
119
119
120
+ 'django_nose' ,
121
+
120
122
'model_filters' ,
121
123
122
124
'pepulator_factory' ,
123
125
)
124
126
127
+ TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
128
+
125
129
# A sample logging configuration. The only tangible logging
126
130
# performed by this configuration is to send an email to
127
131
# the site admins on every HTTP 500 error.
Original file line number Diff line number Diff line change 1
1
Django
2
2
mock
3
+ django-nose
4
+ coverage
Original file line number Diff line number Diff line change
1
+ """
2
+ python setup.py test
3
+
4
+ """
5
+ import os
6
+ import sys
7
+
8
+ os .environ ["DJANGO_SETTINGS_MODULE" ] = 'example_project.settings'
9
+ from example_project import settings
10
+
11
+ settings .INSTALLED_APPS = (
12
+ # 'django.contrib.auth',
13
+ # 'django.contrib.sessions',
14
+ # 'django.contrib.contenttypes',
15
+ # 'django.contrib.admin',
16
+ # 'django.contrib.sites',
17
+ # 'demo_project.profiles',
18
+ 'model_filters' ,
19
+ )
20
+
21
+ def main ():
22
+ from django .test .utils import get_runner
23
+ test_runner = get_runner (settings )(interactive = False )
24
+ failures = test_runner .run_tests (['model_filters' ,])
25
+ sys .exit (failures )
26
+
27
+ if __name__ == '__main__' :
28
+ main ()
You can’t perform that action at this time.
0 commit comments