def test_snapshot_detail_view(self): snapshot, conn = self.make_snapshot() request = self.create_request(matchdict=dict(id=snapshot.id)) view = SnapshotView(request, ec2_conn=conn).snapshot_view() view_snapshot = view.get('snapshot') self.assertEqual(view_snapshot.id, snapshot.id) self.assertEqual(view.get('snapshot_name'), snapshot.id) self.assertEqual(view.get('snapshot_description'), u'test snapshot description') self.assertEqual(view.get('exists_volume'), True)
def test_snapshot_update_view(self): """Snapshot update should contain the snapshot form""" request = testing.DummyRequest(post=True) view = SnapshotView(request).snapshot_update() self.assertTrue(view.get('snapshot_form') is not None)