<commit_before>import json
import re
import urllib
import urlparse

from django.core.urlresolvers import reverse

from pombola.experiments.models import Event, Experiment
from pombola.feedback.models import Feedback

from django_webtest import WebTest

from nose.plugins.attrib import attr

@attr(country='kenya')
class CountyPerformancePageTests(WebTest):

    def setUp(self):
        self.experiment = Experiment.objects.create(
            slug='mit-county',
            name='MIT County Performance experiment')

    def tearDown(self):
        self.experiment.delete()
        Feedback.objects.all().delete()

    def test_page_view(self):
        response = self.app.get('/county-performance')
        self.assertEqual(response.status_code, 200)
        self.assertTrue(response.html.get('a', {'id': 'share-facebook'}))
        self.assertTrue(response.html.get('a', {'id': 'share-twitter'}))
        self.assertFalse(
            response.html.findAll('div', {'id': 'surveyPromoBanner'}))
        self.assertFalse(
            response.html.findAll('div', {'id': 'opportunity'}))
        self.assertFalse(
            response.html.findAll('div', {'id': 'threat'}))

    def test_threat_variant(self):
        response = self.app.get('/county-performance?variant=t')
        self.assertEqual(response.status_code, 200)
        self.assertEqual(
            1, len(response.html.findAll('div', {'id': 'threat'})))
        self.assertFalse(
            response.html.findAll('div', {'id': 'opportunity'}))

    def test_threat_opportunity(self):
        response = self.app.get('/county-performance?variant=o')
        self.assertEqual(response.status_code, 200)
        self.assertEqual(
            1, len(response.html.findAll('div', {'id': 'opportunity'})))
        self.assertFalse(
            response.html.findAll('div', {'id': 'threat'}))

    def test_threat_neither(self):<commit_msg>Fix County Performance page test names<commit_after>import json
import re
import urllib
import urlparse

from django.core.urlresolvers import reverse

from pombola.experiments.models import Event, Experiment
from pombola.feedback.models import Feedback

from django_webtest import WebTest

from nose.plugins.attrib import attr

@attr(country='kenya')
class CountyPerformancePageTests(WebTest):

    def setUp(self):
        self.experiment = Experiment.objects.create(
            slug='mit-county',
            name='MIT County Performance experiment')

    def tearDown(self):
        self.experiment.delete()
        Feedback.objects.all().delete()

    def test_page_view(self):
        response = self.app.get('/county-performance')
        self.assertEqual(response.status_code, 200)
        self.assertTrue(response.html.get('a', {'id': 'share-facebook'}))
        self.assertTrue(response.html.get('a', {'id': 'share-twitter'}))
        self.assertFalse(
            response.html.findAll('div', {'id': 'surveyPromoBanner'}))
        self.assertFalse(
            response.html.findAll('div', {'id': 'opportunity'}))
        self.assertFalse(
            response.html.findAll('div', {'id': 'threat'}))

    def test_threat_variant(self):
        response = self.app.get('/county-performance?variant=t')
        self.assertEqual(response.status_code, 200)
        self.assertEqual(
            1, len(response.html.findAll('div', {'id': 'threat'})))
        self.assertFalse(
            response.html.findAll('div', {'id': 'opportunity'}))

    def test_opportunity_variant(self):
        response = self.app.get('/county-performance?variant=o')
        self.assertEqual(response.status_code, 200)
        self.assertEqual(
            1, len(response.html.findAll('div', {'id': 'opportunity'})))
        self.assertFalse(
            response.html.findAll('div', {'id': 'threat'}))

    def test_neither_variant(self):
{'fraction_non_alphanumeric': 0.14155131888221467, 'fraction_numerical': 0.00574562548968399, 'mean_word_length': 3.1812227074235806, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '3357308', 'n_tokens_mistral': 1166, 'n_tokens_neox': 1103, 'n_words': 206}