From f72297be32140c306736587eab5ed1bac67b4c29 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Fri, 20 Feb 2009 14:06:27 -0800 Subject: [PATCH] Additional unit tests for exporting. --- controller/test/Test_notebooks.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/controller/test/Test_notebooks.py b/controller/test/Test_notebooks.py index 14039cb..461bb48 100644 --- a/controller/test/Test_notebooks.py +++ b/controller/test/Test_notebooks.py @@ -4471,6 +4471,28 @@ class Test_notebooks( Test_controller ): assert len( notes ) == 1 assert notes[ 0 ].object_id == note3.object_id + def test_export_with_invalid_format( self ): + self.login() + + result = self.http_get( + "/notebooks/export?notebook_id=%s&format=foo^^bar" % self.notebook.object_id, + session_id = self.session_id, + ) + + assert u"error" in result[ "body" ][ 0 ] + assert u"format is invalid" in result[ "body" ][ 0 ] + + def test_export_with_unknown_format( self ): + self.login() + + result = self.http_get( + "/notebooks/export?notebook_id=%s&format=foobar" % self.notebook.object_id, + session_id = self.session_id, + ) + + assert u"error" in result[ "body" ][ 0 ] + assert u"format is unknown" in result[ "body" ][ 0 ] + def test_export_html( self ): self.login()