Esempio n. 1
0
 def test_get_queryset(self):
     """
     Test :py:meth:`.MultipleObjectMixin.get_queryset`.
     """
     mixin = MultipleObjectMixin()
     mixin.document_class = Mock()
     self.assertEqual(mixin.document_class.objects, mixin.get_queryset())
Esempio n. 2
0
 def test_get_queryset(self):
     """
     Test :py:meth:`.MultipleObjectMixin.get_queryset`.
     """
     mixin = MultipleObjectMixin()
     mixin.document_class = Mock()
     self.assertEqual(mixin.document_class.objects, mixin.get_queryset())
Esempio n. 3
0
    def test_get_ontext_object_name_from_object(self):
        """
        Test :py:meth:`.MultipleObjectMixin.get_context_object_name`.

        This tests generating the object name from the document class.

        """
        class MyObject(object):
            pass

        mixin = MultipleObjectMixin()
        mixin.document_class = MyObject
        self.assertEqual('myobject_list', mixin.get_context_object_name())
Esempio n. 4
0
    def test_get_ontext_object_name_from_object(self):
        """
        Test :py:meth:`.MultipleObjectMixin.get_context_object_name`.

        This tests generating the object name from the document class.

        """
        class MyObject(object):
            pass

        mixin = MultipleObjectMixin()
        mixin.document_class = MyObject
        self.assertEqual('myobject_list', mixin.get_context_object_name())