Closed epogrebnyak closed 6 years ago
you can use fixtures for that purpose: https://docs.djangoproject.com/en/1.11/topics/testing/tools/#django.test.TransactionTestCase.fixtures
The most straightforward way of creating a fixture is to use the manage.py dumpdata command. This assumes you already have some data in your database. See the dumpdata documentation for more details.
Once you’ve created a fixture and placed it in a fixtures directory in one of your INSTALLED_APPS, you can use it in your unit tests by specifying a fixtures class attribute on your django.test.TestCase subclass:
Also, you need tests specific settings to configure different from other settings DATABASE setting
Fixtures is good point for tests now.
Implemented
for the purposes of select / filter methods we need a little more datapoint in test database.
I'm not sure how we add them now (add once and clone sqlite or make script with insert/update datapoints methods), but the data is here:
https://github.com/mini-kep/full-app/issues/9#issuecomment-331814995