# Path: nuntium/user_section/forms.py
# class WriteItInstanceBasicForm(ModelForm):
#     class Meta:
# class WriteItInstanceAnswerNotificationForm(ModelForm):
#     class Meta:
# class WriteItInstanceWebBasedForm(ModelForm):
#     class Meta:
# class WriteItInstanceModerationForm(ModelForm):
#     class Meta:
# class WriteItInstanceApiAutoconfirmForm(ModelForm):
#     class Meta:
# class WriteItInstanceMaxRecipientsForm(ModelForm):
#     class Meta:
# class WriteItInstanceRateLimiterForm(ModelForm):
#     class Meta:
# class NewAnswerNotificationTemplateForm(ModelForm):
#     class Meta:
# class ConfirmationTemplateForm(ModelForm):
#     class Meta:
# class SimpleInstanceCreateFormPopitUrl(WriteItInstanceCreateFormPopitUrl):
#     class Meta:
# class WriteItInstanceCreateForm(WriteItInstanceCreateFormPopitUrl):
#     class Meta:
# class AnswerForm(ModelForm):
#     class Meta:
# class RelatePopitInstanceWithWriteItInstance(Form, PopitParsingFormMixin):
# class WriteItPopitUpdateForm(ModelForm):
#     class Meta:
# class WebhookCreateForm(ModelForm):
#     class Meta:
#     def __init__(self, *args, **kwargs):
#     def save(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):
#     def save(self, commit=True):
#     def __init__(self, *args, **kwargs):
#     def save(self, commit=True):
#     def __init__(self, *args, **kwargs):
#     def clean_slug(self):
#     def save(self, commit=True):
#     def __init__(self, *args, **kwargs):
#     def save(self, commit=True):
#     def __init__(self, *args, **kwargs):
#     def relate(self):
#     def clean(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):
#     def save(self, commit=True):


from global_test_case import GlobalTestCase as TestCase, popit_load_data
from ..user_section.forms import WriteItInstanceCreateFormPopitUrl, SimpleInstanceCreateFormPopitUrl
from django.contrib.auth.models import User
from django.conf import settings
from mock import patch
# coding=utf-8


class InstanceCreateFormTestCase(TestCase):
    def setUp(self):
        super(InstanceCreateFormTestCase, self).setUp()
        self.user = User.objects.first()

    def test_instantiate_the_form(self):
        '''Instantiate the form for creating a writeit instance'''
        data = {
            'owner': self.user.id,
            'popit_url': settings.TEST_POPIT_API_URL,
            'name': "instance",
            "rate_limiter": 0,
            }
        form = WriteItInstanceCreateFormPopitUrl(data)

        self.assertTrue(form)
        self.assertTrue(form.is_valid())

    @popit_load_data()
    def test_creating_an_instance(self):
        '''Create an instance of writeit using a form that contains a popit_url'''
        data = {
            'owner': self.user.id,
            'popit_url': settings.TEST_POPIT_API_URL,
            'name': "instance",
            "rate_limiter": 0,
            }

# Path: nuntium/user_section/forms.py
# class WriteItInstanceBasicForm(ModelForm):
#     class Meta:
# class WriteItInstanceAnswerNotificationForm(ModelForm):
#     class Meta:
# class WriteItInstanceWebBasedForm(ModelForm):
#     class Meta:
# class WriteItInstanceModerationForm(ModelForm):
#     class Meta:
# class WriteItInstanceApiAutoconfirmForm(ModelForm):
#     class Meta:
# class WriteItInstanceMaxRecipientsForm(ModelForm):
#     class Meta:
# class WriteItInstanceRateLimiterForm(ModelForm):
#     class Meta:
# class NewAnswerNotificationTemplateForm(ModelForm):
#     class Meta:
# class ConfirmationTemplateForm(ModelForm):
#     class Meta:
# class SimpleInstanceCreateFormPopitUrl(WriteItInstanceCreateFormPopitUrl):
#     class Meta:
# class WriteItInstanceCreateForm(WriteItInstanceCreateFormPopitUrl):
#     class Meta:
# class AnswerForm(ModelForm):
#     class Meta:
# class RelatePopitInstanceWithWriteItInstance(Form, PopitParsingFormMixin):
# class WriteItPopitUpdateForm(ModelForm):
#     class Meta:
# class WebhookCreateForm(ModelForm):
#     class Meta:
#     def __init__(self, *args, **kwargs):
#     def save(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):
#     def save(self, commit=True):
#     def __init__(self, *args, **kwargs):
#     def save(self, commit=True):
#     def __init__(self, *args, **kwargs):
#     def clean_slug(self):
#     def save(self, commit=True):
#     def __init__(self, *args, **kwargs):
#     def save(self, commit=True):
#     def __init__(self, *args, **kwargs):
#     def relate(self):
#     def clean(self, *args, **kwargs):
#     def __init__(self, *args, **kwargs):
#     def save(self, commit=True):


# Path: nuntium/tests/writeitinstance_newform_tests.py
from global_test_case import GlobalTestCase as TestCase, popit_load_data
from ..user_section.forms import WriteItInstanceCreateFormPopitUrl, SimpleInstanceCreateFormPopitUrl
from django.contrib.auth.models import User
from django.conf import settings
from mock import patch

# coding=utf-8


class InstanceCreateFormTestCase(TestCase):
    def setUp(self):
        super(InstanceCreateFormTestCase, self).setUp()
        self.user = User.objects.first()

    def test_instantiate_the_form(self):
        '''Instantiate the form for creating a writeit instance'''
        data = {
            'owner': self.user.id,
            'popit_url': settings.TEST_POPIT_API_URL,
            'name': "instance",
            "rate_limiter": 0,
            }
        form = WriteItInstanceCreateFormPopitUrl(data)

        self.assertTrue(form)
        self.assertTrue(form.is_valid())

    @popit_load_data()
    def test_creating_an_instance(self):
        '''Create an instance of writeit using a form that contains a popit_url'''
        data = {
            'owner': self.user.id,
            'popit_url': settings.TEST_POPIT_API_URL,
            'name': "instance",
            "rate_limiter": 0,
            }

        form = WriteItInstanceCreateFormPopitUrl(data)