user12718229
user12718229

Reputation:

Can not run tests in APITestCase

Structure of project

proj/
  apps/
    app1/
      ...
      tests.py
    ...
  proj/

tests.py

class UsersTestCase(APITestCase):
    def setUp(self):
        self.user = User.objects.get(id=3)
        self.client = APIClient()

    def test_users_list(self):
        ...

I run python manage.py test --settings=proj.settings.local and see Ran 0 tests in 0.000s

Why?

Upvotes: 0

Views: 994

Answers (1)

hashlash
hashlash

Reputation: 1015

Try adding the module as test argument

python manage.py test --settings=proj.settings.local apps.app1

If it still failed, check if you have 'apps.app1' in your INSTALLED_APPS

Upvotes: 1

Related Questions