1 | | Guys, I, as many others, use sqlite database to run local dev-server and for tests (production is running postgresql). I was writing test that needs to ensure that object is "recreated", so that it and it's foreign objects linking him are also recreated. As a first implementation (when I didn't know that pk can be reused in SQLite), what I did is to expect DoesNotExist error under old object's pk (which should be deleted). But now, since new one is created instead of that object, object under that pk is present in database. |
| 1 | Guys, I, as many others, use sqlite database to run local dev-server and for tests (production is running postgresql). I was writing test that needs to ensure that object is "recreated" (we decided to implement "edit" operation on complex object graph as first removing main object with it's dependencies and then re-creating main object with same pk, and then adding it's dependencies), so that it and it's foreign objects linking him are first removed, and then new one with same pk is created, and then new objects linking it are created (not setting their pk). As a first implementation (when I didn't know that pk can be reused in SQLite), what I did is to expect DoesNotExist error under old object's pk (which should be deleted). But now, since new one is created instead of that object, object under that pk is present in database. |