Exemple #1
0
    def test_url_contains_protocol_success(self):
        domain = 'https://www.google.com'

        form = SiteForm(data={'domain': domain})
        if form.is_valid():
            site = form.save()

        self.assertEqual(site.domain, "www.google.com")
Exemple #2
0
    def test_form_validation_success(self):
        domain = 'www.google.com'

        form = SiteForm(data={'domain': domain})
        if form.is_valid():
            site = form.save()

        self.assertEqual(site.domain, domain)
Exemple #3
0
    def test_form_validation_success(self):
        domain = 'www.google.com'

        form = SiteForm(data={'domain': domain})
        if form.is_valid():
            site = form.save()

        self.assertEqual(site.domain, domain)
Exemple #4
0
    def test_url_contains_protocol_success(self):
        domain = 'https://www.google.com'

        form = SiteForm(data={'domain': domain})
        if form.is_valid():
            site = form.save()

        self.assertEqual(site.domain, "www.google.com")
Exemple #5
0
    def test_wrong_url_no_success(self):
        domain = 'mailto:[email protected]?subjects=pajcek.lala.net'

        form = SiteForm(data={'domain': domain})
        self.assertFalse(form.is_valid())
Exemple #6
0
    def test_wrong_url_no_success(self):
        domain = 'mailto:[email protected]?subjects=pajcek.lala.net'

        form = SiteForm(data={'domain': domain})
        self.assertFalse(form.is_valid())