How to run tests in django using database with data?
问题 I want to test my views using data from postgres localhost database (with already loaded data). I'm using tox with pytest and pytest-django. My question: How to set up / connect to local database to get all the data model schema and data itself? Or maybe it is better to use factory_boy? Or to load whole data from .sql script (if yes, how)? Example of my test: def test_foo_view(custom_client_login): response = custom_client_login.get('/foo/bar/123/') assert response.status_code == 200 assert