Exemple #1
0
    def good_form_test(self):
        """
        Test a good form.
        """

        test_data = {'long_url': 'www.google.com'}
        form = ShortLinksForm(data = test_data)
        self.assertEqual(form.is_valid(), True)
Exemple #2
0
    def bad_form_test(self):
        """
        Test a bad form.
        """

        test_data = {'long_url': ''}
        form = ShortLinksForm(data = test_data)
        self.assertEqual(form.is_valid(), False)