Esempio n. 1
0
    def test_forward__should_drop_collection(self, load_fixture, test_db, dump_db):
        schema = load_fixture('schema1').get_schema()
        dump = dump_db()

        action = DropDocument('Schema1Doc1')
        action.prepare(test_db, schema, MigrationPolicy.strict)
        expect = deepcopy(dump)
        del expect['schema1_doc1']

        action.run_forward()

        assert expect == dump_db()
    def test_forward__on_unexistance_collection_specified__should_do_nothing(
            self, load_fixture, test_db, dump_db):
        schema = load_fixture('schema1').get_schema()
        schema['Schema1Doc1'].parameters['collection'] = 'unknown_collection'
        dump = dump_db()

        action = DropDocument('Schema1Doc1')
        action.prepare(test_db, schema, MigrationPolicy.strict)

        action.run_forward()

        assert dump == dump_db()