~ubuntu-branches/ubuntu/quantal/python-django/quantal-security

« back to all changes in this revision

Viewing changes to tests/regressiontests/forms/fields.py

  • Committer: Bazaar Package Importer
  • Author(s): Jamie Strandboge
  • Date: 2010-10-12 11:34:35 UTC
  • mfrom: (4.4.9 sid)
  • mto: This revision was merged to the branch mainline in revision 30.
  • Revision ID: james.westby@ubuntu.com-20101012113435-5rk3p18nyanuhj6g
* SECURITY UPDATE: XSS in CSRF protections. New upstream release
  - CVE-2010-3082
* debian/patches/01_disable_url_verify_regression_tests.diff:
  - updated to disable another test that fails without internet connection
  - patch based on work by Kai Kasurinen and Krzysztof Klimonda
* debian/control: don't Build-Depends on locales-all, which doesn't exist
  in maverick

Show diffs side-by-side

added added

removed removed

Lines of Context:
739
739
    # FilePathField ###############################################################
740
740
 
741
741
    def test_filepathfield_65(self):
742
 
        path = forms.__file__
 
742
        path = os.path.abspath(forms.__file__)
743
743
        path = os.path.dirname(path) + '/'
744
 
        assert fix_os_paths(path).endswith('/django/forms/')
 
744
        self.assertTrue(fix_os_paths(path).endswith('/django/forms/'))
745
745
 
746
746
    def test_filepathfield_66(self):
747
747
        path = forms.__file__
748
 
        path = os.path.dirname(path) + '/'
 
748
        path = os.path.dirname(os.path.abspath(path)) + '/'
749
749
        f = FilePathField(path=path)
750
750
        f.choices = [p for p in f.choices if p[0].endswith('.py')]
751
751
        f.choices.sort()
760
760
            ]
761
761
        for exp, got in zip(expected, fix_os_paths(f.choices)):
762
762
            self.assertEqual(exp[1], got[1])
763
 
            assert got[0].endswith(exp[0])
 
763
            self.assertTrue(got[0].endswith(exp[0]))
764
764
        self.assertRaisesErrorWithMessage(ValidationError, "[u'Select a valid choice. fields.py is not one of the available choices.']", f.clean, 'fields.py')
765
765
        assert fix_os_paths(f.clean(path + 'fields.py')).endswith('/django/forms/fields.py')
766
766
 
767
767
    def test_filepathfield_67(self):
768
768
        path = forms.__file__
769
 
        path = os.path.dirname(path) + '/'
 
769
        path = os.path.dirname(os.path.abspath(path)) + '/'
770
770
        f = FilePathField(path=path, match='^.*?\.py$')
771
771
        f.choices.sort()
772
772
        expected = [
780
780
            ]
781
781
        for exp, got in zip(expected, fix_os_paths(f.choices)):
782
782
            self.assertEqual(exp[1], got[1])
783
 
            assert got[0].endswith(exp[0])
 
783
            self.assertTrue(got[0].endswith(exp[0]))
784
784
 
785
785
    def test_filepathfield_68(self):
786
 
        path = forms.__file__
 
786
        path = os.path.abspath(forms.__file__)
787
787
        path = os.path.dirname(path) + '/'
788
788
        f = FilePathField(path=path, recursive=True, match='^.*?\.py$')
789
789
        f.choices.sort()
800
800
            ]
801
801
        for exp, got in zip(expected, fix_os_paths(f.choices)):
802
802
            self.assertEqual(exp[1], got[1])
803
 
            assert got[0].endswith(exp[0])
 
803
            self.assertTrue(got[0].endswith(exp[0]))
804
804
 
805
805
    # SplitDateTimeField ##########################################################
806
806