Пример #1
0
    def test_unregister(self):
        "Unregistering a serializer doesn't cause the registry to be repopulated. Refs #14823"
        serializers.unregister_serializer('xliff')

        public_formats = serializers.get_public_serializer_formats()

        self.assertNotIn('xliff', public_formats)
Пример #2
0
    def test_unregister(self):
        "Unregistering a serializer doesn't cause the registry to be repopulated. Refs #14823"
        serializers.unregister_serializer('xliff')

        public_formats = serializers.get_public_serializer_formats()

        self.assertNotIn('xliff', public_formats)
Пример #3
0
    def test_unregister(self):
        "Unregistering a serializer doesn't cause the registry to be repopulated. Refs #14823"
        serializers.unregister_serializer('xml')
        serializers.register_serializer('json3', 'django.core.serializers.json')

        public_formats = serializers.get_public_serializer_formats()

        self.assertNotIn('xml', public_formats)
        self.assertIn('json3', public_formats)
Пример #4
0
    def test_unregister(self):
        "Unregistering a serializer doesn't cause the registry to be repopulated. Refs #14823"
        serializers.unregister_serializer('xml')
        serializers.register_serializer('json3', 'django.core.serializers.json')

        public_formats = serializers.get_public_serializer_formats()

        self.assertNotIn('xml', public_formats)
        self.assertIn('json3', public_formats)
Пример #5
0
    def test_unregister(self):
        """
        Unregistering a serializer doesn't cause the registry to be
        repopulated.
        """
        serializers.unregister_serializer("xml")
        serializers.register_serializer("json3", "django.core.serializers.json")

        public_formats = serializers.get_public_serializer_formats()

        self.assertNotIn("xml", public_formats)
        self.assertIn("json3", public_formats)
Пример #6
0
 def test_unregister_unkown_serializer(self):
     with self.assertRaises(SerializerDoesNotExist):
         serializers.unregister_serializer("nonsense")
Пример #7
0
 def test_unregister_unkown_serializer(self):
     with self.assertRaises(SerializerDoesNotExist):
         serializers.unregister_serializer("nonsense")