]> asedeno.scripts.mit.edu Git - bluechips.git/blobdiff - bluechips/tests/functional/test_user.py
Fix division of currency
[bluechips.git] / bluechips / tests / functional / test_user.py
index b5c91364ec6c4c36169dd426a2a0439760788663..96b0198cb2c862e2f253432689d7bbc7ff67b9d7 100644 (file)
@@ -6,8 +6,8 @@ from bluechips.model import meta
 
 class TestUserController(TestController):
 
-    def test_index(self):
-        response = self.app.get(url_for(controller='user'))
+    def test_email(self):
+        response = self.app.get(url_for(controller='user', action='email'))
         # Test response...
         response.mustcontain('Email Notifications', 'User Settings')
         form = response.form
@@ -20,7 +20,7 @@ class TestUserController(TestController):
         assert user.email == 'test@example.com'
 
     def test_clear_email(self):
-        response = self.app.get(url_for(controller='user'))
+        response = self.app.get(url_for(controller='user', action='email'))
         form = response.form
         form['new_email'] = ''
         response = form.submit().follow()
@@ -30,4 +30,8 @@ class TestUserController(TestController):
                 filter_by(username=unicode(config['fake_username'])).one()
         assert user.email == None
 
-
+    def test_xsrf_protection(self):
+        self.app.post(url_for(controller='user',
+                              action='update'),
+                      {'new_email': 'malicious@example.com'},
+                      status=403)