~ubuntu-branches/ubuntu/natty/moin/natty-updates

« back to all changes in this revision

Viewing changes to MoinMoin/action/_tests/test_attachfile.py

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2008-06-22 21:17:13 UTC
  • mto: This revision was merged to the branch mainline in revision 18.
  • Revision ID: james.westby@ubuntu.com-20080622211713-inlv5k4eifxckelr
ImportĀ upstreamĀ versionĀ 1.7.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
        """
57
57
        Tests if AttachFile.getFilename creates the attachment dir on self.requesting
58
58
        """
59
 
        become_trusted(self.request)
60
 
 
61
59
        filename = ""
62
 
 
63
60
        file_exists = os.path.exists(AttachFile.getFilename(self.request, self.pagename, filename))
64
61
 
65
62
        nuke_page(self.request, self.pagename)
66
63
 
67
64
        assert file_exists
68
65
 
 
66
    def test_getAttachUrl(self):
 
67
        """
 
68
        Tests if AttachFile.getAttachUrl taints a filename
 
69
        """
 
70
        filename = "<test2.txt>"
 
71
        expect = "rename=_test2.txt_&"
 
72
        result = AttachFile.getAttachUrl(self.pagename, filename, self.request, upload=True)
 
73
 
 
74
        assert expect in result
 
75
 
69
76
coverage_modules = ['MoinMoin.action.AttachFile']