Can't figure out testing in python. More specifically, backend testing on django. The challenge is this. There is a class A with doAA and doBB methods. Accordingly, there is a test class TestA (unittest.TestCase), containing tests testDoAA and testDoBB.
Everything is fine and everything suits, but until then, until the class B appears, the set of methods is identical to class A.
That is, B and A perform some tasks slightly differently. To write one more class, such as TestB, with copying there everything from TestA is seen as barbaric and in the wrong way.
Tell me, how can I describe the test once and run it twice for two similar classes? and forgive me for terminological and other errors, for me, Python is a new and painfully unusual language.
ps: I wanted to call the question like this: "Run python unittest for the interface, not for the class", but this is not exactly the case.