<commit_before>from django.core.urlresolvers import reverse
from django.test import TestCase
import factory

from .factories import KlassFactory, ProjectVersionFactory
from .views import Sitemap


class SitemapTest(TestCase):
    def test_200(self):
        ProjectVersionFactory.create()
        response = self.client.get(reverse('sitemap'))
        self.assertEqual(response.status_code, 200)
        self.assertEqual(response['Content-Type'], 'application/xml')

    def test_queryset(self):
        klass = KlassFactory.create()
        with self.assertNumQueries(2):  # Get ProjectVersion, get Klasses.
            url_list = Sitemap().get_queryset()
        self.assertEqual(len(url_list), 2)  # 2 because 1 Klass + homepage.

<commit_msg>PEP8.<commit_after>from django.core.urlresolvers import reverse
from django.test import TestCase

from .factories import KlassFactory, ProjectVersionFactory
from .views import Sitemap


class SitemapTest(TestCase):
    def test_200(self):
        ProjectVersionFactory.create()
        response = self.client.get(reverse('sitemap'))
        self.assertEqual(response.status_code, 200)
        self.assertEqual(response['Content-Type'], 'application/xml')

    def test_queryset(self):
        klass = KlassFactory.create()
        with self.assertNumQueries(2):  # Get ProjectVersion, get Klasses.
            url_list = Sitemap().get_queryset()
        self.assertEqual(len(url_list), 2)  # 2 because 1 Klass + homepage.

{'fraction_non_alphanumeric': 0.10013623978201634, 'fraction_numerical': 0.01430517711171662, 'mean_word_length': 3.693290734824281, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4644547', 'n_tokens_mistral': 441, 'n_tokens_neox': 418, 'n_words': 96}