def testShouldReturnAppropriateBodyWhenSessionIsNone(self): view = SessionJsonView() try: result = view.render_session(None) except Exception: return self.fail('Exception expected')
def testShouldReturnAppropriateBodyWithValidSession(self): expected = \ """{"session" : { "id" : "ses123", "userid" : "user123", "name" : "user name" }}""" view = SessionJsonView() session = Session('ses123', 'user123', 'user name') result = view.render_session(session) self.assertEqual(result, expected)