0

HiEveryone

Got some problem why trying to load fixtures in Django test database.

  1. I made fixture of DB by exec command
python manage.py dumpdata misxapp --format=yaml --indent=4 >  misxapp/fixtures/misxapp.yaml
  1. In misxapp.tests.py I use StaticLiveServerTestCase class property "fixtures"
fixtures = ['misxapp']
  1. Then I run test
python manage.py test misxapp.tests.TestAuthorization.test_login

and get exception

psycopg2.errors.UndefinedColumn: ERROR:  column "date" in table "misxapp_insurancepolicy" doesn't exist.
LINE 1: ..., "organization_id_id" = 34, "person_id_id" = 23, "date" = '...

!!! BUT !!!

column "date" exists both in models.py file and Postgresql database(table misxapp_insurancepolicy) enter image description here enter image description here

I assume that the problem is in the naming of the date field in Postgresql, but not sure at all. please tell me in which direction to dig, thanks!!!

meshi
  • 1
  • 2

0 Answers0