How do I run tests in test_project?

30 views
Skip to first unread message

Li-Wen Yip

unread,
Jun 24, 2017, 8:31:14 AM6/24/17
to yourlabs
How do I run the tests in test_project?

I've been trying to figure this out for several weeks and I'm stumped.

I have already run
pip install -r requirements.txt

If I try to run all the tests, I get a blank Firefox browser window that that doesn't do anything. This is the console output:

PS C:\Users\Li-Wen Yip\Documents\GitHub\django-autocomplete-light\test_project> python .\manage.py test
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
....C:\ProgramData\Anaconda3\lib\site-packages\django\core\paginator.py:112: UnorderedObjectListWarning: Pagination may yield inconsistent results with an unordered object_list: <QuerySet []>
 
UnorderedObjectListWarning
.......................E

If I try to run just one test suite, I get errors:

PS C:\Users\Li-Wen Yip\Documents\GitHub\django-autocomplete-light\test_project> python .\manage.py test .\select2_list\
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
..EE
======================================================================
ERROR
: setUpClass (select2_list.test_functional.AdminSelect2List)
----------------------------------------------------------------------
Traceback (most recent call last):
 
File "C:\ProgramData\Anaconda3\lib\site-packages\selenium\webdriver\common\service.py", line 74, in start
    stdout
=self.log_file, stderr=self.log_file)
 
File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 707, in __init__
    restore_signals
, start_new_session)
 
File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 990, in _execute_child
    startupinfo
)
FileNotFoundError: [WinError 2] The system cannot find the file specified


During handling of the above exception, another exception occurred:


Traceback (most recent call last):
 
File "C:\ProgramData\Anaconda3\lib\site-packages\dal\test\case.py", line 30, in setUpClass
    GLOBAL_BROWSER
= Browser(os.environ.get('BROWSER', 'firefox'))
 
File "C:\ProgramData\Anaconda3\lib\site-packages\splinter\browser.py", line 63, in Browser
   
return driver(*args, **kwargs)
 
File "C:\ProgramData\Anaconda3\lib\site-packages\splinter\driver\webdriver\firefox.py", line 48, in __init__
    timeout
=timeout)
 
File "C:\ProgramData\Anaconda3\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 142, in __init__
   
self.service.start()
 
File "C:\ProgramData\Anaconda3\lib\site-packages\selenium\webdriver\common\service.py", line 81, in start
    os
.path.basename(self.path), self.start_error_message)
selenium
.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.




======================================================================
ERROR
: select2_list.test_views (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: select2_list.test_views
Traceback (most recent call last):
 
File "C:\ProgramData\Anaconda3\lib\unittest\loader.py", line 428, in _find_test_path
   
module = self._get_module_from_name(name)
 
File "C:\ProgramData\Anaconda3\lib\unittest\loader.py", line 369, in _get_module_from_name
    __import__
(name)
 
File "C:\Users\Li-Wen Yip\Documents\GitHub\django-autocomplete-light\test_project\select2_list\test_views.py", line 3, in <module>
   
from dal.autocomplete import Select2GroupListView, Select2ListView
ImportError: cannot import name 'Select2GroupListView'




----------------------------------------------------------------------
Ran 3 tests in 0.027s


FAILED
(errors=2)
Destroying test database for alias 'default'...
PS C
:\Users\Li-Wen Yip\Documents\GitHub\django-autocomplete-light\test_project>



jp...@yourlabs.org

unread,
Jun 24, 2017, 9:50:32 AM6/24/17
to yourlabs
Reply all
Reply to author
Forward
0 new messages