Did I find the right examples for you? yes no

All Samples(25)  |  Call(13)  |  Derive(0)  |  Import(12)

src/e/u/Euphorie-6.3.1/src/euphorie/client/api/users.py   Euphorie(Download)
from ..model import Account
from .authentication import authenticate_token
from .authentication import generate_token
from .account import login_available
from .account import View as AccountView
 
        info = user_info(account, self.request)
        info['token'] = generate_token(account)
        return info
 
 
        info = user_info(account, self.request)
        info['token'] = generate_token(account)
        return info
 

src/e/u/Euphorie-6.3.1/src/euphorie/content/api/tests/test_sectors.py   Euphorie(Download)
    def test_authenticated_user(self):
        import json
        from ...tests.utils import createSector
        from ..authentication import generate_token
        sector = createSector(self.portal, login='sector', password=u'sector')
        browser = Browser()
        browser.handleErrors = False
        browser.addHeader('X-Euphorie-Token', generate_token(sector))
    def test_add_new_sector(self):
        import json
        from ..authentication import generate_token
        self.loginAsPortalOwner()
        country = self.portal.sectors['nl']
        browser.handleErrors = False
        browser.raiseHttpErrors = False
        browser.addHeader('X-Euphorie-Token', generate_token(country['manager']))
        browser.post('http://nohost/plone/api/countries/nl/sectors',
                json.dumps({'title': u'IT development',

src/e/u/Euphorie-6.3.1/src/euphorie/content/api/tests/test_managers.py   Euphorie(Download)
    def test_authenticated_user(self):
        import json
        from ...tests.utils import createSector
        from ..authentication import generate_token
        sector = createSector(self.portal, login='sector', password=u'sector')
        browser = Browser()
        browser.handleErrors = False
        browser.addHeader('X-Euphorie-Token', generate_token(sector))
    def test_add_new_manager(self):
        import json
        from ..authentication import generate_token
        self.loginAsPortalOwner()
        country = self.portal.sectors['nl']
        browser.handleErrors = False
        browser.raiseHttpErrors = False
        browser.addHeader('X-Euphorie-Token', generate_token(country['manager']))
        browser.post('http://nohost/plone/api/countries/nl/managers',
                json.dumps({'title': u'Jane Doe',

src/e/u/Euphorie-6.3.1/src/euphorie/content/api/tests/test_countrymanager.py   Euphorie(Download)
    def test_browser_authenticated_user(self):
        import json
        from ...tests.utils import createSector
        from ..authentication import generate_token
        self.loginAsPortalOwner()
        self.portal.sectors['nl'].invokeFactory('euphorie.countrymanager', 'manager')
        sector = createSector(self.portal, login='sector', password=u'sector')
        browser = Browser()
        browser.handleErrors = False
        browser.addHeader('X-Euphorie-Token', generate_token(sector))
    def test_browser_sector_can_not_modify_manager(self):
        import mock
        import json
        from ...tests.utils import createSector
        from ..authentication import generate_token
        browser = Browser()
        browser.raiseHttpErrors = False
        browser.addHeader('X-Euphorie-Token', generate_token(sector))
        with mock.patch('mechanize._opener.Request.get_method', return_value='PUT'):
            browser.post('http://nohost/plone/api/countries/nl/managers/manager',

src/e/u/Euphorie-6.3.1/src/euphorie/content/api/tests/test_sector.py   Euphorie(Download)
    def test_browser_authenticated_user(self):
        import json
        from ...tests.utils import createSector
        from ..authentication import generate_token
        self.loginAsPortalOwner()
        self.portal.sectors['nl'].invokeFactory('euphorie.countrymanager', 'manager')
        sector = createSector(self.portal, login='sector', password=u'sector')
        browser = Browser()
        browser.handleErrors = False
        browser.addHeader('X-Euphorie-Token', generate_token(sector))

src/e/u/Euphorie-6.3.1/src/euphorie/content/api/tests/test_entry.py   Euphorie(Download)
    def test_authenticated_user(self):
        import json
        from ...tests.utils import createSector
        from ..authentication import generate_token
        sector = createSector(self.portal, login='sector', password=u'sector')
        browser = Browser()
        browser.addHeader('X-Euphorie-Token', generate_token(sector))

src/e/u/Euphorie-6.3.1/src/euphorie/content/api/tests/test_country.py   Euphorie(Download)
    def test_authenticated_user(self):
        import json
        from ...tests.utils import createSector
        from ..authentication import generate_token
        sector = createSector(self.portal, login='sector', password=u'sector')
        browser = Browser()
        browser.handleErrors = False
        browser.addHeader('X-Euphorie-Token', generate_token(sector))

src/e/u/Euphorie-6.3.1/src/euphorie/content/api/tests/test_countries.py   Euphorie(Download)
    def test_authenticated_user(self):
        import json
        from ...tests.utils import createSector
        from ..authentication import generate_token
        sector = createSector(self.portal, login='sector', password=u'sector')
        browser = Browser()
        browser.handleErrors = False
        browser.addHeader('X-Euphorie-Token', generate_token(sector))

src/e/u/Euphorie-6.3.1/src/euphorie/content/api/tests/test_authentication.py   Euphorie(Download)
    def generate_token(self, *a, **kw):
        from ..authentication import generate_token
        return generate_token(*a, **kw)
 
    def test_token_depends_on_login(self):