Test (2)


Django TDD setup

Unit Tests Setup 1. Create virtual env. pipenv shell 2. Install django pipenv install django 3. Create django project. django-admin startproject tested 4. Create .gitignore file touch .gitignore settings setup a settings file for tests. This will use an in-memory sqlite DB (sqlite3). This is good because we don’t want a PG or MySQL db […]




Using Pytest with Django and Django Rest Framework

This article is inspired by article here. What is Pytest Pytest is testing framework for Python. Very popular with Django. Killer feature : Fixtures Fixtures are the killer feature of Pytest. Fixtures are functions that run before and after each test, like setUp and tearDown in unitest and labelled pytest killer feature. Fixtures are used […]