012dac29b8
The unit test uses sqlite for test which closes db foreign keys function by default. This patch enabled the sqlite foreign keys function for unit test by default. The "project" table is a self referencing FK table(id <-> domain_id column). So when the FK is enabled, there must exists a root record before insert data to this table. It's <<keystone.domain.root>>. Usually, the <<keystone.domain.root>> recored is inserted into the table once operators run "keystone-manage db_sync" command when deploy Keystone. But the unit test code doesn't run this command, it initialise the db schema by reading sqlalchemy object model, so the <<keystone.domain.root>> record is missed. Then we can't create any project record, it'll raise FK error. So in this patch, before creating any projects in the test, we must ensure the <<keystone.domain.root>> record exists first. Change-Id: I565d12395ca39a58ba90faf8641a9e02d986aeb9 Closes-Bug: #1744195 |
||
---|---|---|
.. | ||
notes | ||
source |