# Path: pyuploadcare/dj/conf.py

# 
# Path: pyuploadcare/dj/forms.py
# class FileWidget(TextInput):
#     class Media:
# class FileField(Field):
# class ImageField(FileField):
# class FileGroupField(Field):
# class ImageGroupField(FileGroupField):
#     def __init__(self, attrs=None):
#     def render(self, name, value, attrs=None, renderer=None):
#     def __init__(self, *args, **kwargs):
#     def to_python(self, value):
#     def widget_attrs(self, widget):
#     def __init__(self, manual_crop=None, *args, **kwargs):
#     def widget_attrs(self, widget):
#     def __init__(self, *args, **kwargs):
#     def to_python(self, value):
#     def widget_attrs(self, widget):
#     def widget_attrs(self, widget):


import unittest
from django import forms
from django.core.exceptions import ValidationError
from pyuploadcare.dj import conf as dj_conf
from pyuploadcare.dj import forms as uc_forms
        )
        expected_cdn_url = (
            "https://ucarecdn.com/cde35b21-c5e1-4ed4-b2fc-d4ef4b0538b0/"
        )

        self.assertEqual(cdn_url, expected_cdn_url)

    def test_raises_exc_if_value_is_invalid(self):
        with self.assertRaises(ValidationError):
            uc_forms.FileField().clean("blah")

    def test_empty_values_are_allowed(self):
        file_field = uc_forms.FileField(required=False)

        self.assertEqual(file_field.clean(""), "")
        self.assertIsNone(file_field.clean(None))


class FileGroupFieldURLTest(unittest.TestCase):
    def test_returns_url_if_uuid_is_given(self):
        cdn_url = uc_forms.FileGroupField().clean(
            "0513dda0-582f-447d-846f-096e5df9e2bb~2"
        )
        expected_cdn_url = (
            "https://ucarecdn.com/0513dda0-582f-447d-846f-096e5df9e2bb~2/"
        )

        self.assertEqual(cdn_url, expected_cdn_url)

    def test_returns_url_if_url_has_aleady_been_given(self):

# Path: pyuploadcare/dj/conf.py

# 
# Path: pyuploadcare/dj/forms.py
# class FileWidget(TextInput):
#     class Media:
# class FileField(Field):
# class ImageField(FileField):
# class FileGroupField(Field):
# class ImageGroupField(FileGroupField):
#     def __init__(self, attrs=None):
#     def render(self, name, value, attrs=None, renderer=None):
#     def __init__(self, *args, **kwargs):
#     def to_python(self, value):
#     def widget_attrs(self, widget):
#     def __init__(self, manual_crop=None, *args, **kwargs):
#     def widget_attrs(self, widget):
#     def __init__(self, *args, **kwargs):
#     def to_python(self, value):
#     def widget_attrs(self, widget):
#     def widget_attrs(self, widget):


# Path: tests/dj/test_forms.py
import unittest
from django import forms
from django.core.exceptions import ValidationError
from pyuploadcare.dj import conf as dj_conf
from pyuploadcare.dj import forms as uc_forms

        )
        expected_cdn_url = (
            "https://ucarecdn.com/cde35b21-c5e1-4ed4-b2fc-d4ef4b0538b0/"
        )

        self.assertEqual(cdn_url, expected_cdn_url)

    def test_raises_exc_if_value_is_invalid(self):
        with self.assertRaises(ValidationError):
            uc_forms.FileField().clean("blah")

    def test_empty_values_are_allowed(self):
        file_field = uc_forms.FileField(required=False)

        self.assertEqual(file_field.clean(""), "")
        self.assertIsNone(file_field.clean(None))


class FileGroupFieldURLTest(unittest.TestCase):
    def test_returns_url_if_uuid_is_given(self):
        cdn_url = uc_forms.FileGroupField().clean(
            "0513dda0-582f-447d-846f-096e5df9e2bb~2"
        )
        expected_cdn_url = (
            "https://ucarecdn.com/0513dda0-582f-447d-846f-096e5df9e2bb~2/"
        )

        self.assertEqual(cdn_url, expected_cdn_url)

    def test_returns_url_if_url_has_aleady_been_given(self):

        cdn_url = uc_forms.FileGroupField().clean(