def test_chartwidget_crud(): w = ChartWidget( generate_random_string(), description=generate_random_string(), active=True, filter="Configuration Management/Virtual Machines/Vendor and Guest OS", timer={"run": "Hourly", "hours": "Hour"}, visibility=["<By Role>", sel.ByText("EvmRole-administrator")] ) w.create() with update(w): w.active = False w.delete()
def custom_widgets(request): ws = [ MenuWidget(fauxfactory.gen_alphanumeric(), description=fauxfactory.gen_alphanumeric(), active=True, shortcuts={ "Services / Catalogs": fauxfactory.gen_alphanumeric(), "Clouds / Providers": fauxfactory.gen_alphanumeric(), }, visibility="<To All Users>"), ReportWidget(fauxfactory.gen_alphanumeric(), description=fauxfactory.gen_alphanumeric(), active=True, filter=[ "Events", "Operations", "Operations VMs Powered On/Off for Last Week" ], columns=["VM Name", "Message"], rows="10", timer={ "run": "Hourly", "hours": "Hour" }, visibility="<To All Users>"), ChartWidget( fauxfactory.gen_alphanumeric(), description=fauxfactory.gen_alphanumeric(), active=True, filter= "Configuration Management/Virtual Machines/Vendor and Guest OS", timer={ "run": "Hourly", "hours": "Hour" }, visibility="<To All Users>"), RSSFeedWidget(fauxfactory.gen_alphanumeric(), description=fauxfactory.gen_alphanumeric(), active=True, type="Internal", feed="Administrative Events", rows="8", visibility="<To All Users>"), ] map(lambda w: w.create(), ws) # create all widgets request.addfinalizer( lambda: map(lambda w: w.delete(), ws)) # Delete them after test return ws