Exemple #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()
    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()
 def setup(self):
     super().setup()
     dp.populate_impressions(self.session_context)
     pt.generate_templates(self.session_context)