We consider models for time-to-event data that allow that an event, e.g., a relapse of a disease, never occurs for a certain percentage of the population, called the cure rate. We suppose that these data are subject to random right censoring and we model the data using a mixture cure model, in which the survival function of the uncured subjects is left unspecified. The aim is to test whether the cure rate , as a function of the covariates, satisfies a certain parametric model. To do so, we propose a test statistic that is inspired by a goodness-of-fit test for a regression function due to Hardle & Mammen (1993). We show that the statistic is asymptotically normally distributed under the null hypothesis, that the model is correctly specified, and under local alternatives. A bootstrap procedure is proposed to implement the test. The good performance of the approach is confirmed with simulations. For illustration we apply the test to data on the times between first and second births.