20👍
You need both these files under your app folder:
__init__.py
models.py
They can be empty.
2👍
What error do you get? And what do you have under your INSTALLED_APPS
in settings.py
?
if you have something like
INSTALLED_APPS = (
'django.contrib.auth',
...
'apps.appname1',
'apps.appname2',
)
and __init__.py
in the apps
directory then it should work.
- Django Test Client post() returns 302 despite error on view's post()
- 'WSGIRequest' object has no attribute 'session' while upgrading from django 1.3 to 1.9
- Django: check for modeladmin for a given model
1👍
Just a note, the settings.py file contains a tuple so the termination character should be ‘)’ not ‘}’
1👍
In django 2.2.4 , using a folder for test files i.e. \test
, instead of the default test.py
file. This is what worked for me.
python manage.py test .\apps-folder\app1
If you are also using a folder for test files, make sure include a __init__.py
- Default value for foreign key in Django migrations.AddField
- OSError: dlopen(libSystem.dylib, 6): image not found
- How to store Django hashed password without the User object?
0👍
Make sure apps
has an __init__.py
. You should be able to run your tests by app name:
python2 manage.py test appname1
This works under Django 1.3, I haven’t tested any other versions.
- Django error: [<class 'decimal.InvalidOperation'>]
- How do I check if a given datetime object is "between" two datetimes?
- TemplateSyntaxError: 'with' expected with atleast one variable assignment
- No module named 'django.contrib.staticfiles.templatetags'
- Django Rest Framework 3.1 breaks pagination.PaginationSerializer
0👍
This is a bit late as an answer, but for future reference of other peeps coming across this I was running into the same problem, and found that I needed to add an empty models.py
file to the app. (It didn’t need any database tables, but not having a models.py
meant that the test runner was not picking it up.)