def persist_data(self, data): for doc in data: FakeModel(**doc) # Index the document with .index() FakeDjangoMappingType.index(doc, id_=doc["id"]) self.refresh(FakeDjangoMappingType.get_index())
def persist_data(self, data): for doc in data: FakeModel(**doc) # Index the document with .index() FakeDjangoMappingType.index(doc, id_=doc['id']) self.refresh(FakeDjangoMappingType.get_index())
def test_index(self): document = {'id': 1, 'name': 'odin skullcrusher'} # Generate the FakeModel in our "database" FakeModel(**document) # Index the document with .index() FakeDjangoMappingType.index(document, id_=document['id']) self.refresh(FakeDjangoMappingType.get_index()) # Query it to make sure it's there. eq_(len(S(FakeDjangoMappingType).query(name__prefix='odin')), 1)
def test_index(self): document = {'id': 1, 'name': 'odin skullcrusher'} # Generate the FakeModel in our "database" FakeModel(**document) # Index the document with .index() FakeDjangoMappingType.index(document, id_=document['id']) self.refresh(FakeDjangoMappingType.get_index()) # Query it to make sure it's there. eq_(len(S(FakeDjangoMappingType).query(name__prefix='odin')), 1)