def test_set_current(self):
        for status in ('failed', 'invalidated', 'active'):
            resp = self.client.post(self.path, data={
                'status': status,
                'set_current': True,
            })

            options = dict(db.session.query(
                ProjectOption.name, ProjectOption.value
            ).filter(
                ProjectOption.project == self.project,
            ))

            if status == 'active':
                assert resp.status_code == 200
                assert options.get('snapshot.current') == self.snapshot.id.hex
            else:
                assert resp.status_code == 400
                assert options.get('snapshot.current') != self.snapshot.id.hex
dataset/ETHPy150Open dropbox/changes/tests/changes/api/test_snapshot_details.py/UpdateSnapshotTest.test_set_current/original