Beispiel #1
0
    def test_generate_string(self):
        length = 42
        str_1 = utils.generate_string(length)
        str_2 = utils.generate_string(length)

        self.assertEqual(len(str_1), length)
        self.assertEqual(len(str_2), length)
        self.assertNotEqual(str_1, str_2)  # Generated strings shouldn't be the same
    def test_generate_string(self):
        length = 42
        str_1 = utils.generate_string(length)
        str_2 = utils.generate_string(length)

        self.assertEqual(len(str_1), length)
        self.assertEqual(len(str_2), length)
        self.assertNotEqual(str_1,
                            str_2)  # Generated strings shouldn't be the same
def get_authentication_uri():
    """Prepare and return URL to authentication service login form."""
    csrf = generate_string(20)
    _persist_data(csrf=csrf)
    params = {
        'response_type': 'code',
        'redirect_uri': url_for('login.musicbrainz_post', _external=True),
        'scope': 'profile',
        'state': csrf,
    }
    return _musicbrainz.get_authorize_url(**params)
Beispiel #4
0
def get_authentication_uri():
    """Prepare and return URL to authentication service login form."""
    csrf = generate_string(20)
    _persist_data(csrf=csrf)
    params = {
        'response_type': 'code',
        'redirect_uri': url_for('login.musicbrainz_post', _external=True),
        'scope': 'profile',
        'state': csrf,
    }
    return _musicbrainz.get_authorize_url(**params)