def test_update_dashboard_name(self): od = call(OwnerDashboardsTest.test_inserting) db = od.dashboards[3] db.update(dashboard_name='ABC', dashboard_options={'x': 20}) db_u = Dashboard.select(db['owner_id'], db.dashboard_id) self.assertEqual('ABC', db_u.dashboard_name) self.assertEqual({'x': 20}, db_u.dashboard_options)
def test_select(self): od = call(OwnerDashboardsTest.test_inserting) db = Dashboard.select(od.dashboards[0]['owner_id'], od.dashboards[0].dashboard_id) self.assertEqual(od.dashboards[0], db) self.assertNotEqual(od.dashboards[1], db) self.assertEqual(od.dashboards[0].dashboard_name, db.dashboard_name)
def test_select_nonexisting(self): self.assertIsNone(Dashboard.select(uuid.uuid1(), uuid.uuid1()))