def create_candlepin_pool(pool_uuid=None, account_id=None, product_id=None, product_name=None): if not pool_uuid: pool_uuid = "unit_test_pool_id" if not account_id: account_id = "1" if not product_id: product_id = "unit_test_product_id" if not product_name: product_name = "unit_test_product_name" pool = Pool( uuid=pool_uuid, account=account_id, product_id=product_id, product_name=product_name, created=datetime.now(tzutc()), start_date=datetime.now(tzutc()), end_date=datetime.now(tzutc()), updated=datetime.now(tzutc()), quantity=1, ) pool.save() return pool
def get_existing(self, obj): return Pool.objects(uuid=obj.uuid).first()
def drop_pools(self): from report_server.sreport.models import Pool Pool.drop_collection()
def drop_collections(self): Pool.drop_collection()