Index: main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py	(revision 10647)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py	(revision 10681)
@@ -199,4 +199,5 @@
         hostel.hostel_id = u'hall-1'
         hostel.hostel_name = u'Hall 1'
+        hostel.maint_fee = 876.0
         self.app['hostels'].addHostel(hostel)
         bed = Bed()
@@ -2941,4 +2942,18 @@
         self.assertMatches('...Payment ticket created...',
                            self.browser.contents)
+
+        ctrl = self.browser.getControl(name='val_id')
+        value = ctrl.options[0]
+        # Maintennace fee is taken from the hostel object
+        self.assertEqual(self.student['payments'][value].amount_auth, 876.0)
+        # If the hostel's maintenance fee isn't set, the fee is
+        # taken from the session configuration object.
+        self.app['hostels']['hall-1'].maint_fee = 0.0
+        self.browser.open(self.payments_path + '/addop')
+        self.browser.getControl(name="form.p_category").value = ['hostel_maintenance']
+        self.browser.getControl("Create ticket").click()
+        ctrl = self.browser.getControl(name='val_id')
+        value = ctrl.options[1]
+        self.assertEqual(self.student['payments'][value].amount_auth, 987.0)
         return
 
