Purgeable / full-app

Keep all functionality for (parsers + db + frontend API) inside one Django project.
0 stars 1 forks source link

put trail dataset in test database #26

Closed epogrebnyak closed 6 years ago

epogrebnyak commented 6 years ago

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

Rub4ek commented 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

tinivir commented 6 years ago

Fixtures is good point for tests now.

Rub4ek commented 6 years ago

Implemented