I had it turn off by typing the above code. Testing cheats don't matter at all. It's not it that makes buydebug function.
The testingCheatsEnabled cheat is
indeed what makes the buyDebug cheat function. Without it, you can't access to the buyDebug cheat at all. It comes up as an unknown command.
But I just tried to turn it off again, and I was pleasantly surprised to see that it
did work. I immediately figured out what the problem was: if testingCheatsEnabled is turned off, you can't turn off the buyDebug menu. So, yes it
does matter. But I stand corrected on my part.