Exemplo n.º 1
0
    def test_raises_without_version(self):
        file = self.addon.current_version.current_file
        serializer = FileInfoSerializer(instance=file)

        with self.assertRaises(RuntimeError):
            serializer.data
Exemplo n.º 2
0
    def get_serializer(self, **extra_context):
        extra_context.setdefault('version', self.version)
        extra_context['request'] = self.request

        return FileInfoSerializer(instance=self.file, context=extra_context)