# 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
        '''It parses a popit url without version'''
        popit_url = self.form.get_popit_url_parsed('http://the-instance.popit.mysociety.org/api/')
        self.assertEquals(popit_url, 'https://the-instance.popit.mysociety.org/api/v0.1')
        popit_url = self.form.get_popit_url_parsed('http://the-instance.popit.mysociety.org/api')
        self.assertEquals(popit_url, 'https://the-instance.popit.mysociety.org/api/v0.1')

    def test_using_http_instead_of_http(self):
        '''It uses http if an https is given this should be removed ASAP
        or when we find out why it is failing'''
        popit_url = self.form.get_popit_url_parsed('https://the-instance.popit.mysociety.org/api/')
        self.assertEquals(popit_url, 'https://the-instance.popit.mysociety.org/api/v0.1')
        popit_url = self.form.get_popit_url_parsed('https://the-instance.popit.mysociety.org/api')
        self.assertEquals(popit_url, 'https://the-instance.popit.mysociety.org/api/v0.1')

        popit_url = self.form.get_popit_url_parsed('https://the-instance.popit.mysociety.org/api/v0.1')
        self.assertEquals(popit_url, 'https://the-instance.popit.mysociety.org/api/v0.1')


class BasicInstanceCreateFormTestCase(TestCase):
    def setUp(self):
        super(BasicInstanceCreateFormTestCase, self).setUp()

    def test_the_form_is_a_subclass_of_the_more_complicated_version(self):
        '''This form is a subclass of the more confirmation verions'''

        form = SimpleInstanceCreateFormPopitUrl()
        self.assertIsInstance(form, WriteItInstanceCreateFormPopitUrl)

    def test_fields(self):
        '''The simple form for creating writeit instances contains the correct fields'''

# 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

        '''It parses a popit url without version'''
        popit_url = self.form.get_popit_url_parsed('http://the-instance.popit.mysociety.org/api/')
        self.assertEquals(popit_url, 'https://the-instance.popit.mysociety.org/api/v0.1')
        popit_url = self.form.get_popit_url_parsed('http://the-instance.popit.mysociety.org/api')
        self.assertEquals(popit_url, 'https://the-instance.popit.mysociety.org/api/v0.1')

    def test_using_http_instead_of_http(self):
        '''It uses http if an https is given this should be removed ASAP
        or when we find out why it is failing'''
        popit_url = self.form.get_popit_url_parsed('https://the-instance.popit.mysociety.org/api/')
        self.assertEquals(popit_url, 'https://the-instance.popit.mysociety.org/api/v0.1')
        popit_url = self.form.get_popit_url_parsed('https://the-instance.popit.mysociety.org/api')
        self.assertEquals(popit_url, 'https://the-instance.popit.mysociety.org/api/v0.1')

        popit_url = self.form.get_popit_url_parsed('https://the-instance.popit.mysociety.org/api/v0.1')
        self.assertEquals(popit_url, 'https://the-instance.popit.mysociety.org/api/v0.1')


class BasicInstanceCreateFormTestCase(TestCase):
    def setUp(self):
        super(BasicInstanceCreateFormTestCase, self).setUp()

    def test_the_form_is_a_subclass_of_the_more_complicated_version(self):
        '''This form is a subclass of the more confirmation verions'''

        form = SimpleInstanceCreateFormPopitUrl()
        self.assertIsInstance(form, WriteItInstanceCreateFormPopitUrl)

    def test_fields(self):
        '''The simple form for creating writeit instances contains the correct fields'''

        form = SimpleInstanceCreateFormPopitUrl()