Example #1
0
 def test_set_no_arguments(self):
     with self.client:
         try:
             session['username']
         except KeyError:
             assert True
         else:
             assert False
         set_username()
         assert session['username'] == 'guest'
Example #2
0
 def post(self):
     if self._is_successful_login():
         set_username(username=self.username)
         return self._good_login_html()
     else:
         return self._bad_login_html()
Example #3
0
 def get(self):
     set_username()
     flash("You were successfully logged out")
     return redirect(url_for("content.landing"))
Example #4
0
 def test_with_argument(self):
     with self.client:
         set_username('john')
         assert session['username'] == 'john'