24👍
Sadly there is no such command. Django has no way of telling which apps are “yours” versus which are someone else’s.
What I would suggest is writing a new management command, call it mytest. Then create a new setting MY_INSTALLED_APPS. The mytest command will just run the test for every app in MY_INSTALLED_APPS. You’ll want the mytest command to subclass django.core.management.base.AppCommand. django.core.management.call_command will also be helpful.
The only problem with this method is that you will have to constantly maintain the MY_INSTALLED_APPS setting to make sure it is correct.
2👍
This works better in Django 1.6+: when you run python manage.py test,
only your tests will run (assuming you have the default settings for TEST_RUNNER)
- [Django]-Add a custom button to a Django application's admin page
- [Django]-Default value for user ForeignKey with Django admin
- [Django]-Python (and Django) best import practices
2👍
You could create an management/commands/testmyapps.py for one of your app which has:
from django.core.management.base import BaseCommand, CommandError
import django.core.management.commands.test
from django.core import management
from django.conf import settings
class Command(django.core.management.commands.test.Command):
args = ''
help = 'Test all of MY_INSTALLED_APPS'
def handle(self, *args, **options):
super(Command, self).handle(*(settings.MY_INSTALLED_APPS + args), **options)
- [Django]-Missing Table When Running Django Unittest with Sqlite3
- [Django]-Django: using more than one database with inspectdb?
- [Django]-How to submit form without refreshing page using Django, Ajax, jQuery?
0👍
Use nose django test runner, it takes care of this.
Reference:
Django nose to run only project tests
- [Django]-How to completely dump the data for Django-CMS
- [Django]-CORS error while consuming calling REST API with React
- [Django]-Storing an Integer Array in a Django Database