Move the repetitious code in tests into a `setUp` method (it looks like the same three lines is used in other test classes too so consider making all of them inherit from some base class that does the `setUp`