It's definitely copy and paste. On the one hand I want to keep the tests separate because groups and orgs being similar is an implementation detail that tests should be unaware of, and also because I want to avoid cleverness in the tests. On the other hand, so much copy-pasted code definitely feels bad.

I think we need to think about a general answer to this question: how much cleverness/generic code in the test cases is okay? And how much is too much?

I do think we want to agree a guideline for this because there's always the temptation to write overly generic test code that is impossible to understand and maintain later on (lots of examples of this in CKAN's tests).

"Every line of code increases the maintenance burden" is not true imho, particularly in the tests you can often write 1000 lines of simple and explicit code that will be much less of a maintenance burden than 100 lines of more generic code. The generic code is harder to understand in the first place, and harder to change because a change on one line has many effects throughout the code that depends on it.

In this particular case, I'll try rewriting these as generic group/org tests and see how that comes out...