Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions osf_tests/test_generate_sitemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ def all_included_links(self, user_admin_project_public, user_admin_project_priva
urls_to_include.extend([
user_admin_project_public.url,
user_admin_project_private.url,
project_registration_public.url,
project_preprint_osf.url,
project_preprint_other.url,
registration_active.url,
project_registration_public.url + 'overview',
project_preprint_osf.url + 'overview',
project_preprint_other.url + 'overview',
registration_active.url + 'overview',
f'/preprints/{provider_osf._id}/{preprint_osf._id}',
f'/preprints/{provider_osf._id}/{preprint_osf_version._id}',
f'/preprints/{provider_other._id}/{preprint_other._id}',
Expand Down Expand Up @@ -182,18 +182,18 @@ def test_private_project_link_not_included(self, project_private, create_tmp_dir
with mock.patch('website.settings.STATIC_FOLDER', create_tmp_directory):
urls = get_all_sitemap_urls()

assert urljoin(settings.DOMAIN, project_private.url) not in urls
assert urljoin(settings.DOMAIN, project_private.url + 'overview') not in urls

def test_embargoed_registration_link_not_included(self, registration_embargoed, create_tmp_directory):

with mock.patch('website.settings.STATIC_FOLDER', create_tmp_directory):
urls = get_all_sitemap_urls()

assert urljoin(settings.DOMAIN, registration_embargoed.url) not in urls
assert urljoin(settings.DOMAIN, registration_embargoed.url + 'overview') not in urls

def test_deleted_project_link_not_included(self, project_deleted, create_tmp_directory):

with mock.patch('website.settings.STATIC_FOLDER', create_tmp_directory):
urls = get_all_sitemap_urls()

assert urljoin(settings.DOMAIN, project_deleted.url) not in urls
assert urljoin(settings.DOMAIN, project_deleted.url + 'overview') not in urls
2 changes: 1 addition & 1 deletion scripts/generate_sitemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def generate(self):
for obj in objs:
try:
config = settings.SITEMAP_NODE_CONFIG
config['loc'] = urljoin(settings.DOMAIN, '/{}/'.format(obj['guids___id']))
config['loc'] = urljoin(settings.DOMAIN, '/{}/overview'.format(obj['guids___id']))
config['lastmod'] = obj['modified'].strftime('%Y-%m-%d')
self.add_url(config)
except Exception as e:
Expand Down
Loading