This project has been created for you to practice different types of testing. The source code contains a Django project for a mini e-commerce site. You can use it to develop a set of scenarios needed to test all of the source code. Note that the suggested solutions are available in different branches of the directory structure.
- Install Python 3: Python 3 download
- Install git: Git download
- Download the Project to Your Local Directory:
git clone https://github.com/OpenClassrooms-Student-Center/4425126-testing-python.git
cd 4425126-testing-python
- Set up a Virtual Environment:
- Create the virtual environment:
python -m venv venv
- Activate the virtual environment:
- Windows:
venv\Scripts\activate.bat
- Unix/MacOS:
source venv/bin/activate
- Windows:
- Install project dependencies
pip install -r requirements.txt
- Run the server using the following command:
python manage.py runserver
- Suggested solution for unit testing using Pytest:
git checkout pytest-test
pytest
- Suggested solution for unit testing using fixtures:
git checkout fixture-test
pytest
- Suggested solution for unit testing using classes:
git checkout class-test
pytest
- Suggested solution for integration testing:
git checkout integration-test
pytest
- Suggested solution for functional testing (don't forget to download the webdriver):
git checkout functional-test
python manage.py test
- Suggested solution for performance testing:
git checkout performance-test
locust