Add tests for constraints #6426