<commit_before>import urlparse
from unittest import skip

from django.test.client import Client
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from django.core import mail
from django.conf import settings


from go.apps.tests.base import DjangoGoApplicationTestCase
from go.account.utils import send_user_account_summary
from go.account.tasks import send_scheduled_account_summary


class AccountTestCase(DjangoGoApplicationTestCase):

    def setUp(self):
        super(AccountTestCase, self).setUp()
        self.setup_riak_fixtures()
        self.client = Client()
        self.client.login(username='username', password='password')

    def confirm(self, token_url):
        url = urlparse.urlsplit(token_url)
        return self.client.get(url.path, follow=True)

    def test_update_details(self):
        response = self.client.post(reverse('auth_details'), {
            'name': 'foo',
            'surname': 'bar',
            'email_address': '<EMAIL>',
            'existing_password': 'password',
            '_account': True,
            })
        token_url = response.context['token_url']
        self.confirm(token_url)<commit_msg>Fix test skipping on Python 2.6.<commit_after>import urlparse

from django.test.client import Client
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from django.core import mail
from django.conf import settings
from django.utils.unittest import skip

from go.apps.tests.base import DjangoGoApplicationTestCase
from go.account.utils import send_user_account_summary
from go.account.tasks import send_scheduled_account_summary


class AccountTestCase(DjangoGoApplicationTestCase):

    def setUp(self):
        super(AccountTestCase, self).setUp()
        self.setup_riak_fixtures()
        self.client = Client()
        self.client.login(username='username', password='password')

    def confirm(self, token_url):
        url = urlparse.urlsplit(token_url)
        return self.client.get(url.path, follow=True)

    def test_update_details(self):
        response = self.client.post(reverse('auth_details'), {
            'name': 'foo',
            'surname': 'bar',
            'email_address': '<EMAIL>',
            'existing_password': 'password',
            '_account': True,
            })
        token_url = response.context['token_url']
        self.confirm(token_url)
{'fraction_non_alphanumeric': 0.099626400996264, 'fraction_numerical': 0.0008302200083022001, 'mean_word_length': 3.3580470162748646, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6675691', 'n_tokens_mistral': 667, 'n_tokens_neox': 652, 'n_words': 152}