Тесты для проекта продуктовый помощник
- Соответствие имен проверяемых полей в Моделях:
- User:
usernamepasswordemailfirst_namelast_name
- User:
- Склонировать проект:
git clone git@github.com:pelldis/foodgram_tests.git
- Скопировать папку tests в корневую папку с проектом foodgram:
copy -r tests ../<foodgram directory>/
- Скопировать файлы
pytest.iniиrun.shв корневую папку с проектом foodgram:copy pytest.ini ../<foodgram directory>/copy run.sh ../<foodgram directory>/
- Установить pytest в venv foodgram проект:
pip install pytest
- Возможно понадобится скорректировать переменные в pytest.ini:
python_paths = backend/DJANGO_SETTINGS_MODULE = foodgram.settingsДолжна получиться примерно такая структура project backend/ foodgram/ settings.py ... frontend/ tests/ run.sh pytest.ini ... - Запустить тест из корневой дирректории проекта:
pytest