def test_ensure_match_patch_want_diff_error(self):
        resp = self.client.post(self.path, data={
            'sha': 'a' * 40,
            'project': self.project.slug,
            'apply_project_files_trigger': '1',
            'ensure_only': '1',
            'patch': (StringIO(SAMPLE_DIFF_BYTES), 'foo.diff'),
            'target': 'D123',
        })
        assert resp.status_code == 400
        data = self.unserialize(resp)
        assert 'patch' in data['problems']
        assert 'ensure_only' in data['problems']
This tests that ensure-only mode does not work with diff builds.
dataset/ETHPy150Open dropbox/changes/tests/changes/api/test_build_index.py/BuildCreateTest.test_ensure_match_patch_want_diff_error