Tests should test one thing and one thing only. You can create a class variable dict with the css name and the identifier. Then in the first test, you see if the css class is identical to CssClassOne. If it's not, try to set it as CssClassOne else CssClassTwo. And the same for the second test. It will probably be best to make a helper function and that way you actually don't need a class variable. For the last test I would simply make an assertation first that neither the CssClass nor the flairText is already set.