def test_get_context_object_name_from_attr(self): """ Test :py:meth:`.SingleObjectMixin.get_context_object_name` from attr. """ mixin = SingleObjectMixin() mixin.context_object_name = 'foo' self.assertEqual('foo', mixin.get_context_object_name())