This commit is contained in:
Dave Dash 2010-08-12 09:25:40 -07:00
Родитель 557a22bdc3
Коммит 590195eafc
14 изменённых файлов: 537 добавлений и 9272 удалений

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

@ -9,7 +9,7 @@ from files.models import File
class CurrentVersionTestCase(test_utils.TestCase):
fixtures = ['base/fixtures']
fixtures = ('base/addon_3615',)
def test_addons(self):
Addon.objects.filter(pk=3615).update(_current_version=None)
@ -25,7 +25,7 @@ class CurrentVersionTestCase(test_utils.TestCase):
class TestLastUpdated(test_utils.TestCase):
fixtures = ['base/fixtures']
fixtures = ('base/addon_3615',)
def test_personas(self):
Addon.objects.update(type=amo.ADDON_PERSONA)
@ -61,8 +61,8 @@ class TestLastUpdated(test_utils.TestCase):
ids = Addon.objects.values_list('id', flat=True)
cron._update_appsupport(ids)
eq_(AppSupport.objects.count(), 26)
eq_(AppSupport.objects.count(), 1)
# Run it again to test deletes.
cron._update_appsupport(ids)
eq_(AppSupport.objects.count(), 26)
eq_(AppSupport.objects.count(), 1)

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

@ -11,7 +11,8 @@ from addons.models import Addon
class TestHelpers(amo.test_utils.ExtraSetup, test_utils.TestCase):
fixtures = ['base/fixtures', 'addons/featured.json']
fixtures = ('base/apps', 'base/addon_3615', 'base/addon_4664_twitterbar',
'addons/featured.json',)
def setUp(self):
jingo.load_helpers()
@ -60,7 +61,7 @@ class TestHelpers(amo.test_utils.ExtraSetup, test_utils.TestCase):
'Support this add-on: Contribute $12.00')
def test_contribution_box(self):
a = Addon.objects.get(pk=1003)
a = Addon.objects.get(pk=4664)
a.suggested_amount = '12'
s = contribution({'LANG': 'en-us', 'APP': amo.FIREFOX}, a)
doc = PyQuery(s)

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

@ -17,7 +17,7 @@ from versions.models import Version
class TestAddonManager(amo.test_utils.ExtraSetup, test_utils.TestCase):
fixtures = ['addons/test_manager']
fixtures = ('base/addon_5299_gcal', 'addons/test_manager',)
def test_featured(self):
featured = Addon.objects.featured(amo.FIREFOX)[0]
@ -82,15 +82,23 @@ class TestAddonManager(amo.test_utils.ExtraSetup, test_utils.TestCase):
class TestAddonModels(amo.test_utils.ExtraSetup, test_utils.TestCase):
fixtures = ['base/fixtures', 'addons/featured',
'addons/invalid_latest_version']
fixtures = ('base/apps',
'base/users',
'base/addon_5299_gcal',
'base/addon_3615',
'base/addon_3723_listed',
'base/addon_6704_grapple.json',
'base/addon_4664_twitterbar',
'addons/featured',
'addons/invalid_latest_version',)
def test_current_version(self):
"""
Tests that we get the current (latest public) version of an addon.
"""
a = Addon.objects.get(pk=3615)
eq_(a.current_version.id, 24007)
eq_(a.current_version.id, 81551)
def test_current_version_listed(self):
a = Addon.objects.get(pk=3723)
@ -104,11 +112,7 @@ class TestAddonModels(amo.test_utils.ExtraSetup, test_utils.TestCase):
def test_current_beta_version(self):
a = Addon.objects.get(pk=5299)
eq_(a.current_beta_version.id, 78841)
def test_current_version_unreviewed(self):
a = Addon.objects.get(pk=55)
eq_(a.current_version.id, 55)
eq_(a.current_beta_version.id, 49515)
def test_current_version_mixed_statuses(self):
"""Mixed file statuses are evil (bug 558237)."""
@ -138,10 +142,12 @@ class TestAddonModels(amo.test_utils.ExtraSetup, test_utils.TestCase):
a = Addon.objects.get(pk=3615)
expected = (settings.ADDON_ICON_URL % (3615, 0)).rstrip('/0')
assert a.icon_url.startswith(expected)
a = Addon.objects.get(pk=7172)
a = Addon.objects.get(pk=6704)
a.icon_type = None
assert a.icon_url.endswith('/icons/default-theme.png'), (
"No match for %s" % a.icon_url)
a = Addon.objects.get(pk=73)
a = Addon.objects.get(pk=3615)
a.icon_type = None
assert a.icon_url.endswith('/icons/default-addon.png')
def test_thumbnail_url(self):
@ -149,9 +155,9 @@ class TestAddonModels(amo.test_utils.ExtraSetup, test_utils.TestCase):
Test for the actual thumbnail URL if it should exist, or the no-preview
url.
"""
a = Addon.objects.get(pk=7172)
a.thumbnail_url.index('/previews/thumbs/25/25981.png?modified=')
a = Addon.objects.get(pk=73)
a = Addon.objects.get(pk=4664)
a.thumbnail_url.index('/previews/thumbs/20/20397.png?modified=')
a = Addon.objects.get(pk=5299)
assert a.thumbnail_url.endswith('/icons/no-preview.png'), (
"No match for %s" % a.thumbnail_url)
@ -195,7 +201,7 @@ class TestAddonModels(amo.test_utils.ExtraSetup, test_utils.TestCase):
def test_has_eula(self):
addon = lambda: Addon.objects.get(pk=3615)
assert not addon().has_eula
assert addon().has_eula
a = addon()
a.eula = ''
@ -212,7 +218,7 @@ class TestAddonModels(amo.test_utils.ExtraSetup, test_utils.TestCase):
original reviews.
"""
addon = Addon.objects.get(id=3615)
u = UserProfile.objects.get(pk=2519)
u = UserProfile.objects.get(pk=999)
version = addon.current_version
new_review = Review(version=version, user=u, rating=2, body='hello',
addon=addon)

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

@ -16,13 +16,19 @@ from amo.helpers import urlparams
from amo.urlresolvers import reverse
from addons.models import Addon, AddonUser
from users.models import UserProfile
from tags.models import Tag, AddonTag
from translations.query import order_by_translation
import re
class TestHomepage(amo.test_utils.ExtraSetup, test_utils.TestCase):
fixtures = ['base/fixtures', 'base/global-stats', 'base/featured']
fixtures = ('base/apps',
'base/users',
'base/addon_3615',
'base/collections',
'base/global-stats',
'base/featured')
def setUp(self):
super(TestHomepage, self).setUp()
@ -99,7 +105,7 @@ class TestPromobox(test_utils.TestCase):
class TestContributeInstalled(amo.test_utils.ExtraSetup, test_utils.TestCase):
fixtures = ['base/fixtures']
fixtures = ('base/apps', 'base/addon_592',)
def test_no_header_block(self):
# bug 565493, Port post-install contributions page
@ -119,7 +125,7 @@ class TestContributeInstalled(amo.test_utils.ExtraSetup, test_utils.TestCase):
class TestContribute(amo.test_utils.ExtraSetup, test_utils.TestCase):
fixtures = ['base/fixtures']
fixtures = ('base/apps', 'base/addon_3615', 'base/addon_592',)
def test_invalid_is_404(self):
"""we get a 404 in case of invalid addon id"""
@ -239,7 +245,8 @@ class TestContribute(amo.test_utils.ExtraSetup, test_utils.TestCase):
class TestDeveloperPages(amo.test_utils.ExtraSetup, test_utils.TestCase):
fixtures = ['base/fixtures', 'addons/eula+contrib-addon', 'base/apps']
fixtures = ('base/apps', 'base/addon_3615', 'base/addon_592', 'base/users',
'addons/eula+contrib-addon',)
def test_meet_the_dev_title(self):
r = self.client.get(reverse('addons.meet', args=[592]))
@ -263,6 +270,9 @@ class TestDeveloperPages(amo.test_utils.ExtraSetup, test_utils.TestCase):
assert button.endswith('?src=addondetail'), button
def test_contribute_multiple_devs(self):
a = Addon.objects.get(pk=592)
u = UserProfile.objects.get(pk=999)
AddonUser(addon=a, user=u).save()
r = self.client.get(reverse('addons.meet', args=[592]))
# Make sure it has multiple devs.
assert pq(r.content)('.section-teaser')
@ -270,8 +280,13 @@ class TestDeveloperPages(amo.test_utils.ExtraSetup, test_utils.TestCase):
class TestDetailPage(amo.test_utils.ExtraSetup, test_utils.TestCase):
fixtures = ['base/fixtures', 'base/addon_59.json', 'addons/listed',
'addons/persona']
fixtures = ('base/apps',
'base/addon_3615',
'base/users',
'base/addon_59',
'base/addon_4594_a9',
'addons/listed',
'addons/persona')
def test_anonymous_user(self):
"""Does the page work for an anonymous user?"""
@ -334,7 +349,7 @@ class TestDetailPage(amo.test_utils.ExtraSetup, test_utils.TestCase):
"""Test "other add-ons by author" list."""
# Grab a user and give them some add-ons.
u = UserProfile.objects.get(pk=2519)
u = UserProfile.objects.get(pk=55021)
thisaddon = u.addons.all()[0]
qs = Addon.objects.valid().exclude(pk=thisaddon.pk)
other_addons = order_by_translation(qs, 'name')[:3]
@ -391,7 +406,7 @@ class TestDetailPage(amo.test_utils.ExtraSetup, test_utils.TestCase):
def test_external_urls(self):
"""Check that external URLs are properly escaped."""
addon = Addon.objects.get(id=1843)
addon = Addon.objects.get(id=3615)
response = self.client.get(reverse('addons.detail', args=[addon.id]),
follow=True)
doc = pq(response.content)
@ -400,15 +415,15 @@ class TestDetailPage(amo.test_utils.ExtraSetup, test_utils.TestCase):
def test_other_collection_count(self):
"""Other collection count must not get negative."""
addon = Addon.objects.get(id=1843)
addon = Addon.objects.get(id=3615)
response = self.client.get(reverse('addons.detail', args=[addon.id]),
follow=True)
assert response.context['other_collection_count'] >= 0
def test_no_privacy_policy(self):
"""Make sure privacy policy is shown when present."""
addon = Addon.objects.get(id=1843)
addon.privacy_policy = None
"""Make sure privacy policy is not shown when not present."""
addon = Addon.objects.get(id=3615)
addon.privacy_policy_id = None
addon.save()
response = self.client.get(reverse('addons.detail', args=[addon.id]),
follow=True)
@ -416,7 +431,7 @@ class TestDetailPage(amo.test_utils.ExtraSetup, test_utils.TestCase):
eq_(doc('.privacy-policy').length, 0)
def test_privacy_policy(self):
addon = Addon.objects.get(id=1843)
addon = Addon.objects.get(id=3615)
addon.privacy_policy = 'foo bar'
addon.save()
response = self.client.get(reverse('addons.detail', args=[addon.id]),
@ -460,16 +475,16 @@ class TestDetailPage(amo.test_utils.ExtraSetup, test_utils.TestCase):
"""
Make sure the list of other author addons doesn't include this one.
"""
r = self.client.get(reverse('addons.detail', args=[8680]))
r = self.client.get(reverse('addons.detail', args=[3615]))
doc = pq(r.content)
eq_(len([a.attrib['value'] for a
in doc('#addons-author-addons-select option')
if a.attrib['value'] == '8680']), 0)
if a.attrib['value'] == '3615']), 0)
# Test "other addons" redirect functionality with valid and
# invalid input.
forward_to = lambda input: self.client.get(reverse(
'addons.detail', args=[8680]), {
'addons.detail', args=[3615]), {
'addons-author-addons-select': input})
# Valid input.
response = forward_to('3615')
@ -484,6 +499,9 @@ class TestDetailPage(amo.test_utils.ExtraSetup, test_utils.TestCase):
def test_remove_tag_button(self):
self.client.login(username='regular@mozilla.com', password='password')
tag = Tag(tag_text='f')
tag.save()
AddonTag(addon=Addon.objects.get(pk=3615), tag=tag, user_id=999).save()
r = self.client.get(reverse('addons.detail', args=[3615]))
doc = pq(r.content)
assert len(doc('#tags li input.removetag'))
@ -538,7 +556,6 @@ class TestTagsBox(amo.test_utils.ExtraSetup, test_utils.TestCase):
class TestEulaPolicyRedirects(test_utils.TestCase):
fixtures = ['base/fixtures']
def test_eula_legacy_url(self):
"""

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

@ -0,0 +1,154 @@
[
{
"pk": 29876,
"model": "translations.translation",
"fields": {
"localized_string": "http://f22.aaa.livedoor.jp/~ptdb/firefox/theme.html",
"created": "2007-03-07 22:34:07",
"locale": "ja",
"modified": "2010-01-03 22:27:06",
"id": 15451,
"localized_string_clean": null
}
},
{
"pk": 3723,
"model": "addons.addon",
"fields": {
"dev_agreement": false,
"eula": null,
"last_updated": "2010-01-03 21:26:09",
"view_source": false,
"enable_thankyou": false,
"total_downloads": 418529,
"developer_comments": null,
"inactive": true,
"average_daily_downloads": 1510,
"show_beta": false,
"guid": "{835A3F80-DF39-11D9-A0B5-000D0B3AEB26}",
"trusted": false,
"description": null,
"locale_disambiguation": null,
"binary": false,
"the_future": null,
"weekly_downloads": 0,
"support_url": null,
"paypal_id": "",
"average_rating": "0",
"wants_contributions": false,
"average_daily_users": 18676,
"bayesian_rating": 3.6833499999999999,
"share_count": 0,
"get_satisfaction_company": "",
"homepage": 15451,
"support_email": null,
"public_stats": false,
"status": 6,
"privacy_policy": null,
"total_contributions": "0.00",
"default_locale": "ja",
"target_locale": null,
"prerelease": false,
"thankyou_note": null,
"admin_review": false,
"external_software": false,
"highest_status": 4,
"get_satisfaction_product": "",
"name": null,
"created": "2006-10-31 23:19:06",
"type": 2,
"icon_type": "",
"annoying": 0,
"modified": "2010-08-11 15:30:31",
"summary": null,
"suggested_amount": null,
"site_specific": false,
"total_reviews": 2,
"the_reason": null,
"nomination_date": "2008-09-20 21:43:58"
}
},
{
"pk": 5,
"model": "versions.license",
"fields": {
"_custom_text": null,
"_name_field": 0,
"modified": "2009-04-30 22:29:53",
"created": "2009-04-30 22:29:53"
}
},
{
"pk": 89774,
"model": "versions.version",
"fields": {
"license": 5,
"created": "2010-01-03 21:26:09",
"releasenotes": null,
"modified": "2010-01-03 22:13:50",
"approvalnotes": null,
"version": "0",
"addon": 3723
}
},
{
"pk": 8735,
"model": "auth.user",
"fields": {
"username": "orangefaced@gmail.com",
"first_name": "kozakura",
"last_name": "",
"is_active": true,
"is_superuser": false,
"is_staff": false,
"last_login": "2010-05-23 00:37:12",
"groups": [],
"user_permissions": [],
"password": "",
"email": "orangefaced@gmail.com",
"date_joined": "2007-03-05 13:09:37"
}
},
{
"pk": 8735,
"model": "users.userprofile",
"fields": {
"sandboxshown": true,
"display_collections_fav": false,
"display_collections": false,
"averagerating": "4.75",
"confirmationcode": "",
"notifycompat": false,
"picture_type": "",
"occupation": "",
"homepage": "",
"email": "dd+b2f47812c@davedash.com",
"location": "",
"bio": null,
"firstname": "kozakura",
"deleted": false,
"lastname": "",
"emailhidden": true,
"user": 8735,
"password": "",
"nickname": "8735",
"resetcode_expires": null,
"resetcode": "",
"created": "2007-03-05 13:09:37",
"notes": null,
"modified": "2010-05-11 00:11:05",
"notifyevents": false
}
},
{
"pk": 2905,
"model": "addons.addonuser",
"fields": {
"position": 1,
"addon": 3723,
"role": 5,
"listed": false,
"user": 8735
}
}
]

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

@ -0,0 +1,251 @@
[
{
"pk": 488730,
"model": "translations.translation",
"fields": {
"localized_string": "Public Domain",
"created": "2009-06-29 21:11:38",
"locale": "en-US",
"modified": null,
"id": 447979,
"localized_string_clean": null
}
},
{
"pk": 522467,
"model": "translations.translation",
"fields": {
"localized_string": "I work on addons.mozilla.org.",
"created": "2009-07-15 17:46:47",
"locale": "en-US",
"modified": "2009-07-15 18:02:14",
"id": 480997,
"localized_string_clean": "I work on addons.mozilla.org."
}
},
{
"pk": 60217,
"model": "translations.translation",
"fields": {
"localized_string": "Amazon's A9 search engine",
"created": "2007-03-07 22:59:16",
"locale": "en-US",
"modified": "2008-03-26 21:51:50",
"id": 38147,
"localized_string_clean": "Amazon's A9 search engine"
}
},
{
"pk": 60190,
"model": "translations.translation",
"fields": {
"localized_string": "Amazon's A9 search engine",
"created": "2007-03-07 22:59:16",
"locale": "en-US",
"modified": "2008-03-26 21:51:50",
"id": 38144,
"localized_string_clean": "Amazon's A9 search engine"
}
},
{
"pk": 60199,
"model": "translations.translation",
"fields": {
"localized_string": "http://a9.com/",
"created": "2007-03-07 22:59:16",
"locale": "en-US",
"modified": "2008-03-26 21:51:50",
"id": 38145,
"localized_string_clean": null
}
},
{
"pk": 60208,
"model": "translations.translation",
"fields": {
"localized_string": "A9",
"created": "2007-03-07 22:59:16",
"locale": "en-US",
"modified": "2008-03-26 21:51:50",
"id": 38146,
"localized_string_clean": null
}
},
{
"pk": 144332,
"model": "translations.translation",
"fields": {
"localized_string": "Update to XML (bug 419920)",
"created": "2008-03-26 21:51:43",
"locale": "en-US",
"modified": "2008-03-26 21:51:50",
"id": 108832,
"localized_string_clean": "Update to XML (bug 419920)"
}
},
{
"pk": 1,
"model": "files.platform",
"fields": {
"icontype": "",
"modified": "2008-04-07 08:16:55",
"created": "2007-03-05 13:09:27"
}
},
{
"pk": 4594,
"model": "addons.addon",
"fields": {
"dev_agreement": false,
"eula": null,
"last_updated": "2008-03-26 21:52:58",
"view_source": true,
"enable_thankyou": false,
"total_downloads": 442463,
"developer_comments": null,
"inactive": false,
"average_daily_downloads": 462,
"show_beta": true,
"guid": null,
"trusted": false,
"description": 38144,
"locale_disambiguation": null,
"binary": false,
"the_future": null,
"weekly_downloads": 412,
"support_url": null,
"paypal_id": "",
"average_rating": "2.83",
"wants_contributions": false,
"average_daily_users": 0,
"bayesian_rating": 3.5960800000000002,
"share_count": 0,
"get_satisfaction_company": null,
"homepage": 38145,
"support_email": null,
"public_stats": true,
"status": 4,
"privacy_policy": null,
"total_contributions": "0.00",
"default_locale": "en-US",
"target_locale": null,
"prerelease": false,
"thankyou_note": null,
"admin_review": false,
"external_software": false,
"highest_status": 4,
"get_satisfaction_product": null,
"name": 38146,
"created": "2007-03-06 13:04:32",
"type": 4,
"icon_type": "image/png",
"annoying": 0,
"modified": "2010-05-24 17:32:41",
"summary": 38147,
"suggested_amount": null,
"site_specific": true,
"total_reviews": 12,
"the_reason": null,
"nomination_date": "2008-03-26 22:13:59"
}
},
{
"pk": 312,
"model": "versions.license",
"fields": {
"_custom_text": 447979,
"_name_field": -1,
"modified": "2009-06-29 21:11:38",
"created": "2009-06-29 21:11:38"
}
},
{
"pk": 42352,
"model": "versions.version",
"fields": {
"license": 312,
"created": "2008-03-26 21:51:24",
"releasenotes": 108832,
"modified": "2009-06-29 21:11:38",
"approvalnotes": "",
"version": "20080326",
"addon": 4594
}
},
{
"pk": 25753,
"model": "files.file",
"fields": {
"status": 4,
"codereview": false,
"hash": "sha256:16eecc419987b5c7ed49e4638224f1699c6161890ef2bd292e169e0111054493",
"created": "2008-03-26 21:51:24",
"modified": "2009-06-29 21:11:37",
"filename": "a9.xml",
"platform": 1,
"version": 42352,
"size": 1,
"datestatuschanged": "2008-03-26 21:52:58"
}
},
{
"pk": 10482,
"model": "auth.user",
"fields": {
"username": "clouserw@gmail.com",
"first_name": "Wil",
"last_name": "Clouser",
"is_active": true,
"is_superuser": true,
"is_staff": true,
"last_login": "2010-05-21 16:40:20",
"groups": [],
"user_permissions": [],
"password": "",
"email": "clouserw@gmail.com",
"date_joined": "2007-03-05 13:09:38"
}
},
{
"pk": 10482,
"model": "users.userprofile",
"fields": {
"sandboxshown": false,
"display_collections_fav": true,
"display_collections": true,
"averagerating": "3.38",
"confirmationcode": "",
"notifycompat": true,
"picture_type": "image/jpeg",
"occupation": "Internets",
"homepage": "http://micropipes.com/blog/",
"email": "dd+5dc5f88b0@davedash.com",
"location": "Portland, OR",
"bio": 480997,
"firstname": "Wil",
"deleted": false,
"lastname": "Clouser",
"emailhidden": false,
"user": 10482,
"password": "",
"nickname": "clouserw",
"resetcode_expires": null,
"resetcode": "",
"created": "2007-03-05 13:09:38",
"notes": null,
"modified": "2010-05-20 14:54:52",
"notifyevents": true
}
},
{
"pk": 3649,
"model": "addons.addonuser",
"fields": {
"position": 0,
"addon": 4594,
"role": 5,
"listed": true,
"user": 10482
}
}
]

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

@ -1,4 +1,16 @@
[
{
"pk": 433359,
"model": "translations.translation",
"fields": {
"localized_string": "WebDev",
"created": "2009-06-09 23:35:09",
"locale": "en-US",
"modified": null,
"id": 394557,
"localized_string_clean": null
}
},
{
"pk": 80,
"model": "bandwagon.collection",
@ -19,9 +31,43 @@
"upvotes": 0,
"icontype": "",
"type": 0,
"name": 394557,
"downloads": 46,
"slug": "mccrackin",
"author": 10482
}
},
{
"pk": 1,
"model": "bandwagon.collectionfeature",
"fields": {
"modified": "2010-02-06 14:22:28",
"created": "2009-07-15 17:06:46"
}
},
{
"pk": 47,
"model": "bandwagon.collectionpromo",
"fields": {
"locale": "",
"collection_feature": 1,
"modified": null,
"collection": 80,
"created": "2010-01-05 18:16:11"
}
},
{
"pk": 207981,
"model": "bandwagon.collectionaddon",
"fields": {
"added": "2009-06-09 23:35:10",
"created": null,
"downloads": 30,
"modified": null,
"comments": null,
"user": 10482,
"collection": 80,
"addon": 3615
}
}
]

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

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

@ -7,12 +7,13 @@ from addons.models import Addon
class ManualOrderTest(TestCase):
fixtures = ['base/fixtures']
fixtures = ('base/apps', 'base/addon_3615', 'base/addon_5299_gcal',
'base/addon_40')
def test_ordering(self):
"""Given a specific set of primary keys, assure that we return addons
in that order."""
semi_arbitrary_order = [40, 5299, 3723, 6113]
semi_arbitrary_order = [40, 5299, 3615]
addons = manual_order(Addon.objects.all(), semi_arbitrary_order)
eq_(semi_arbitrary_order, [addon.id for addon in addons])

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

@ -18,7 +18,6 @@ from amo.urlresolvers import reverse
from amo.pyquery_wrapper import PyQuery
from stats.models import SubscriptionEvent
URL_ENCODED = 'application/x-www-form-urlencoded'
@ -65,7 +64,7 @@ def test_404_app_links():
class TestStuff(test_utils.TestCase):
fixtures = ['base/fixtures', 'base/global-stats', 'base/configs']
fixtures = ('base/users', 'base/global-stats', 'base/configs',)
def test_data_anonymous(self):
def check(expected):

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

@ -8,6 +8,7 @@ from bandwagon.models import Collection
class AjaxTest(test_utils.TestCase):
fixtures = ('base/apps', 'base/users', 'base/addon_3615',
'base/addon_5299_gcal',
'base/collections')
def setUp(self):
@ -41,7 +42,7 @@ class AjaxTest(test_utils.TestCase):
def test_new_collection(self):
num_collections = Collection.objects.all().count()
r = self.client.post(reverse('collections.ajax_new'),
{'addon_id': 3615,
{'addon_id': 5299,
'name': 'foo',
'slug': 'auniqueone',
'description': 'yermom',

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

@ -15,8 +15,12 @@ from users.models import UserProfile
class TestHelpers(test.TestCase):
fixtures = ('base/apps', 'base/users', 'base/collections',
'users/test_backends',)
fixtures = ('base/apps',
'base/users',
'base/addon_3615',
'base/collections',
'users/test_backends',
)
def setUp(self):
self.client.get('/')

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

@ -17,8 +17,12 @@ def get_addons(c):
class TestCollections(test_utils.TestCase):
fixtures = ('base/apps', 'base/users', 'base/collections',
'base/addon_3615', 'bandwagon/test_models')
fixtures = ('base/apps',
'base/users',
'base/addon_3615',
'base/collections',
'bandwagon/test_models'
)
def test_icon_url(self):
c = Collection.objects.get(pk=512)

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

@ -128,7 +128,11 @@ class TestVotes(test_utils.TestCase):
class TestCRUD(test_utils.TestCase):
"""Test the collection form."""
fixtures = ('base/apps', 'base/users', 'base/collections', 'base/addon_3615',)
fixtures = ('base/apps',
'base/users',
'base/addon_3615',
'base/collections',
)
def setUp(self):
login = self.client.login(username='admin@mozilla.com',