bug 541175, __utmSetVar("Logged(in|out)")

This commit is contained in:
Jeff Balogh 2010-02-23 14:54:19 -08:00
Родитель abd0ac9540
Коммит 2e0c1c2364
3 изменённых файлов: 21 добавлений и 4 удалений

Просмотреть файл

@ -2,7 +2,8 @@ from django.core.urlresolvers import reverse
from django import test
from nose.tools import eq_
import pyquery
from pyquery import PyQuery
import test_utils
def test_404_no_app():
@ -17,9 +18,23 @@ def test_heading():
c = test.Client()
def title_eq(url, expected):
response = c.get(url, follow=True)
actual = pyquery.PyQuery(response.content)('#title').text()
actual = PyQuery(response.content)('#title').text()
eq_(expected, actual)
title_eq('/firefox', 'Add-ons for Firefox')
title_eq('/thunderbird', 'Add-ons for Thunderbird')
title_eq('/mobile', 'Mobile Add-ons for Firefox')
class TestStuff(test_utils.TestCase):
fixtures = ['base/addons']
def test_data_anonymous(self):
def check(expected):
response = self.client.get('/', follow=True)
anon = PyQuery(response.content)('body').attr('data-anonymous')
eq_(anon, expected)
check('1')
self.client.login(username='admin@mozilla.com', password='password')
check('0')

@ -1 +1 @@
Subproject commit bad644e482efffefe6d1840370ec1934e0f699a5
Subproject commit 6323464281c3c9323b840351920f3ac1adae1d88

Просмотреть файл

@ -14,9 +14,11 @@
{% block extrahead %}{% endblock %}
</head>
{% set anon = not request.user.is_authenticated() and 1 or 0 %}
<body class="html-{{ DIR }} {{ request.APP.short }}
{% block bodyclass %}{% endblock %}"
data-app="{{ request.APP.short }}" data-appname="{{ request.APP.pretty }}">
data-app="{{ request.APP.short }}" data-appname="{{ request.APP.pretty }}"
data-anonymous="{{ anon }}">
<div class="section">
{% block site_header %}