Example #1
0
    def setup_class(cls):
        cls.session_context = tests.init_session()
        cls.db_proxy = cls.session_context.data_proxy

        cls.db_proxy.drop_database()

        dp.populate_products(cls.session_context)
        dp.populate_users(cls.session_context)
        dp.populate_activities(cls.session_context)
        dp.populate_impressions(cls.session_context)
        cls.db_proxy.ensure_indexes(create_ttl_indexes=False)

        cls.db_proxy.backup_database()
Example #2
0
    def setup_class(cls):
        cls.session_context = tests.init_session(cls.custom_settings)
        cls.db_proxy = cls.session_context.data_proxy

        cls.db_proxy.drop_database()
        cls.db_proxy.ensure_indexes(create_ttl_indexes=False)

        # Populate the database
        dp.populate_users(cls.session_context)
        dp.populate_products(cls.session_context)
        product_maintenance.process_products_from_scratch(cls.session_context)
        dp.populate_activities(cls.session_context)

        # Make a backup of the database so that after each test we can send it back to its original state
        cls.db_proxy.backup_database()
Example #3
0
    def setup_class(cls):
        cls.session_context = tests.init_session()
        cls.db_proxy = cls.session_context.data_proxy

        cls.db_proxy.drop_database()
        cls.db_proxy.ensure_indexes(create_ttl_indexes=False)

        cls.session_context.history_decay_function_name = None
        cls.session_context.product_age_decay_function_name = None

        # Populate the database
        dp.populate_products(cls.session_context)
        tasks.process_products(cls.session_context)
        dp.populate_users(cls.session_context)
        dp.populate_activities(cls.session_context)
        dp.populate_impressions(cls.session_context)

        # Make a backup of the database so that after each test we can send it back to its original state
        cls.db_proxy.backup_database()