1

I was following the TDD at O'Reilly and I tried to make the functional_tests to run in isolation as shown here But I'm getting the error:

ImproperlyConfigured: App with label functional_tests could not be found

Directory structure is as below:

├── functional_tests/

│ ├── init.py

│ └── tests.py

├── apps/

│ ├── models.py

...

tests.py contains following code:

from django.test.client import Client
from django.contrib.auth.models import User
from django.test import LiveServerTestCase

from selenium import webdriver
from selenium.webdriver.common.keys import Keys


class FunctionalTest(LiveServerTestCase):

    def setUp(self):
        self.browser = webdriver.Firefox()
        self.browser.implicitly_wait(3)
        self.c = Client()
        self.user = User.objects.create_user(
            username="admin", email="[email protected]", password="admin")

    def tearDown(self):
        self.browser.quit()

    def test_admin_login(self):
        self.browser.get(self.live_server_url)
        # login = self.browser.find_element_by_link_text("Login")

Please tell me what am I doing wrong?

1 Answer 1

1

If you want to run your tests with python manage.py test functional_tests as it shown in the article you should keep functional_tests app in the INSTALLED_APPS. And make sure your PYTHONPATH is set up properly.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.