def test_differing_profile_proj_shortname_rest_api(self): User.upsert('foo_bar') # default auth provider's user_project_shortname() converts _ to - (for subdomain name validation reasons) # but can access user URL with "_" still self.app.get('/rest/u/foo_bar/') # and with "-" too, no redirect here to avoid api clients having to deal with unexpected redirects self.app.get('/rest/u/foo-bar/')
def test_differing_profile_proj_shortname(self): User.upsert('foo_bar') # default auth provider's user_project_shortname() converts _ to - for the project name response = self.app.get('/u/foo_bar/', status=302) assert_equal(response.location, 'http://localhost/u/foo-bar/') response = self.app.get('/u/foo_bar/profile/xyz?a=b', status=302) assert_equal(response.location, 'http://localhost/u/foo-bar/profile/xyz?a=b')
def test_differing_profile_proj_shortname(self): User.upsert('foo_bar') # default auth provider's user_project_shortname() converts _ to - (for subdomain name validation reasons) # but can access user URL with "_" still self.app.get('/u/foo_bar/profile/') # and accessing it by "-" which was the previous way, will redirect response = self.app.get('/u/foo-bar/', status=302) assert_equal(response.location, 'http://localhost/u/foo_bar/') response = self.app.get('/u/foo-bar/profile/xyz?a=b', status=302) assert_equal(response.location, 'http://localhost/u/foo_bar/profile/xyz?a=b')