@@ -0,0 +1,1859 @@
+import pytest%0A%0Afrom django.contrib.sitemaps import Sitemap%0A%0Afrom .. import factories%0Afrom .. import resourcesync%0A%0Apytestmark = %5B%0A    pytest.mark.urls('coda_mdstore.urls'),%0A    pytest.mark.django_db()%0A%5D%0A%0A%0Aclass TestSitemap(Sitemap):%0A    lastmod = None%0A    protocol = 'http'%0A%0A    def items(self):%0A        return factories.FullBagFactory.build_batch(5001)%0A%0A    def location(self, obj):%0A        return %22/bag/%25s%22 %25 obj.name%0A%0A%0Adef test_index(rf):%0A    sitemaps = %7B'001': TestSitemap%7D%0A    request = rf.get('/')%0A    response = resourcesync.index(request, sitemaps, 'mdstore/resourceindex.xml')%0A%0A    content = response.render()%0A%0A    locations = %5B%0A        'resourcelist-001.xml',%0A        'resourcelist-002.xml'%0A    %5D%0A%0A    for loc in locations:%0A        assert loc in str(content)%0A%0A%0Adef test_sitemap(rf):%0A    bags = factories.FullBagFactory.create_batch(10)%0A    request = rf.get('/')%0A    response = resourcesync.sitemap(request, resourcesync.sitemaps, 1, 'mdstore/sitemap.xml')%0A    response.render()%0A%0A    for bag in bags:%0A        assert 'http://example.com/bag/%7B0%7D'.format(bag.name) in response.content%0A        assert 'http://example.com/bag/%7B0%7D.urls'.format(bag.name) in response.content%0A%0A%0Adef test_sitemap_context(rf):%0A    factories.FullBagFactory.create_batch(10)%0A    request = rf.get('/')%0A    response = resourcesync.sitemap(request, resourcesync.sitemaps, 1, 'mdstore/sitemap.xml')%0A    response.render()%0A%0A    urlset = response.context_data%5B'urlset'%5D%0A%0A    assert all(%5BTrue for item in urlset if 'priority' in item.keys()%5D)%0A    assert all(%5BTrue for item in urlset if 'lastmod' in item.keys()%5D)%0A    assert all(%5BTrue for item in urlset if 'changefreq' in item.keys()%5D)%0A    assert all(%5BTrue for item in urlset if 'location' in item.keys()%5D)%0A    assert all(%5BTrue for item in urlset if 'oxum' in item.keys()%5D)%0A%0A    assert 'MOST_RECENT_BAGGING_DATE' in response.context_data%0A

Add tests for resourcesync.