Fixed #20456: easier unit-testing for CBV

Added a class method to return an instance of a CBV.
This allows to unit test part of a CBV directly, without using
the client.