我在奥赖利上跟踪TDD,并试图使functional_tests独立运行,如这里所示,但我得到了错误:
ImproperlyConfigured: App with label functional_tests could not be found目录结构如下:
├──函数测试/
init.py
│└──tests.py
├──应用程序/
│├──models.py
..。
tests.py包含以下代码:
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="admin@agiliq.com", 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")请告诉我我做错了什么?
发布于 2015-01-12 08:39:49
如果您想使用python manage.py test functional_tests运行测试,如本文所示,您应该将functional_tests应用程序保留在INSTALLED_APPS中。并确保你的PYTHONPATH设置正确。
https://stackoverflow.com/questions/27897307
复制相似问题