def test_migrate_v2(): DocumentModelOld.create(**RAW.attributes).save() queryset = DocumentModel.objects(docID=RAW['docID'], source=RAW['source']) assert(len(queryset) == 0) tasks.migrate_to_source_partition(dry=False) queryset = DocumentModel.objects(docID=RAW['docID'], source=RAW['source']) assert(len(queryset) == 1)
def test_migrate_v2(): DocumentModelOld.create(**RAW.attributes).save() queryset = DocumentModel.objects(docID=RAW['docID'], source=RAW['source']) assert len(queryset) == 0 tasks.migrate_to_source_partition(dry=False) queryset = DocumentModel.objects(docID=RAW['docID'], source=RAW['source']) assert len(queryset) == 1
def test_migrate_v2(): try: RAW['doc'] = RAW['doc'].encode('utf-8') except AttributeError: RAW['doc'] = str(RAW['doc']) DocumentModelOld.create(**RAW.attributes).save() queryset = DocumentModel.objects(docID=RAW['docID'], source=RAW['source']) assert len(queryset) == 0 tasks.migrate_to_source_partition(dry=False) queryset = DocumentModel.objects(docID=RAW['docID'], source=RAW['source']) assert len(queryset) == 1