Пример #1
0
 def test_when_logged_out(self):
     g = Mock()
     g.user = None
     with patch('radlibs.web.g', g):
         eq_(build_menu(), {
             'menu': [
                 ('live_demo', 'Try It Live'),
                 ('language', 'The Language'),
             ]})
     response = self.app.get('/')
     assert 'Try It Live' in response.data, "didn't see try it"
     assert 'The Language' in response.data, "didn't see language"
     assert 'Sign In' in response.data, "didn't see signin link"
Пример #2
0
 def test_when_logged_in(self, user):
     g = Mock()
     g.user = user
     with patch('radlibs.web.g', g):
         eq_(build_menu(), {
             'menu': [
                 ('api', 'The API'),
                 ('language', 'The Language'),
                 ('list_associations', 'Associations'),
                 ('profile', 'Profile')
             ]})
     response = self.app.get('/')
     assert 'The Language' in response.data, "didn't see language"
     assert 'Associations' in response.data, "didn't see manage"
     assert 'Log out' in response.data, "didn't see logout link"