Skip to content

101t/django_unittest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Django UnitTest

This is example of Django UnitTest using Selenium.

  • Functional Test using Selenium
  • Unit Test using Django

Usage

to use Selenium, navigate to project directory then create virtual environment

virtualenv -p python3.8 env
source env/bin/activate

pip install -r hashthat/requirements.txt

now download Selenium

wget https://github.com/mozilla/geckodriver/releases/download/v0.31.0/geckodriver-v0.31.0-linux64.tar.gz

tar -xzvf geckodriver-v*-linux64.tar.gz

then link the binary to environment binary

ln -s ./geckodriver env/bin/

to test it

cd hashthat/
python manage.py test

the expected output should be like:

Found 9 test(s).
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
.........
----------------------------------------------------------------------
Ran 9 tests in 14.140s

OK
Destroying test database for alias 'default'...

About

Django UnitTest and Functional Test using Selenium

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published