Exemplo n.º 1
0
    def test_large_capital_opportunity_dbmodels_to_documents(self, opensearch):
        """Tests conversion of db models to OpenSearch documents."""
        opportunities = LargeCapitalOpportunityFactory.create_batch(2)

        result = SearchLargeCapitalOpportunity.db_objects_to_documents(
            opportunities)

        assert len(list(result)) == len(opportunities)
Exemplo n.º 2
0
def get_opportunity_for_search():
    """Sets up search list test by adding many opportunities and returning an opportunity."""
    LargeCapitalOpportunityFactory.create_batch(5)
    opportunity = LargeCapitalOpportunityFactory(
        investment_projects=[InvestmentProjectFactory()], )
    yield opportunity