Fix duplicated code in acc.tests.