I just saw another case when the change has been made in the starting of the string.
In inv/create_category.py test, "Standard > Food" used in test data. Dropdown options include "Food" which ought to be selected. Hence, this test is failing. It used to work fine before, but there was some change in code which made the options change from "Standard > Food" to "Food".

Even if we set rules about how the tests can work, these minor changes will keep giving false negatives and we cannot take for granted that the minor changes in the options strings will always happen in the end.

Hence, given that the algorithm which Graeme suggested is not too complex, I think it fits more in this situation.

However, I am also fine with changing the test data. I just worry that this does not keep on happening and hence, we need to make it a bit more flexible.