summaryrefslogtreecommitdiff
path: root/fundraising
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2022-03-09 09:23:36 +0100
committerGitHub <noreply@github.com>2022-03-09 09:23:36 +0100
commit547fa400157b29f352b1c092330a2a39e0c98bdb (patch)
tree4f58647df606241cb06818266ee8e0d6535ee19a /fundraising
parentba256a4fa850d55f8d67dcc78180b9093efdf155 (diff)
Updated to Django 3.2.
Diffstat (limited to 'fundraising')
-rw-r--r--fundraising/__init__.py1
-rw-r--r--fundraising/tests/test_templatetags.py14
-rw-r--r--fundraising/tests/test_views.py5
3 files changed, 14 insertions, 6 deletions
diff --git a/fundraising/__init__.py b/fundraising/__init__.py
index 7c4c5486..e69de29b 100644
--- a/fundraising/__init__.py
+++ b/fundraising/__init__.py
@@ -1 +0,0 @@
-default_app_config = 'fundraising.apps.FundraisingConfig'
diff --git a/fundraising/tests/test_templatetags.py b/fundraising/tests/test_templatetags.py
index 9cb5ea8e..4227de18 100644
--- a/fundraising/tests/test_templatetags.py
+++ b/fundraising/tests/test_templatetags.py
@@ -41,12 +41,15 @@ class TestDisplayDjangoHeroes(TestCase):
def test_display_django_heroes(self):
def create_hero_with_payment_amount(amount):
hero = DjangoHero.objects.create(
- email='%s@djangoproject.com' % get_random_string(),
+ email='%s@djangoproject.com' % get_random_string(length=12),
approved=True,
is_visible=True,
)
donation = hero.donation_set.create(interval='onetime')
- donation.payment_set.create(amount=amount, stripe_charge_id=get_random_string())
+ donation.payment_set.create(
+ amount=amount,
+ stripe_charge_id=get_random_string(length=12),
+ )
return hero
hero1 = create_hero_with_payment_amount(LEADERSHIP_LEVEL_AMOUNT + 1)
@@ -65,12 +68,15 @@ class TestDisplayDjangoHeroes(TestCase):
"""
def create_hero_with_payment_date(days):
hero = DjangoHero.objects.create(
- email='%s@djangoproject.com' % get_random_string(),
+ email='%s@djangoproject.com' % get_random_string(length=12),
approved=True,
is_visible=True,
)
donation = hero.donation_set.create(interval='onetime')
- payment = donation.payment_set.create(amount=10 + days, stripe_charge_id=get_random_string())
+ payment = donation.payment_set.create(
+ amount=10 + days,
+ stripe_charge_id=get_random_string(length=12),
+ )
date = datetime.today() - timedelta(days=DISPLAY_DONOR_DAYS + days)
Payment.objects.filter(pk=payment.pk).update(date=date)
return hero
diff --git a/fundraising/tests/test_views.py b/fundraising/tests/test_views.py
index 9f350fbe..551427a3 100644
--- a/fundraising/tests/test_views.py
+++ b/fundraising/tests/test_views.py
@@ -6,6 +6,7 @@ from django.conf import settings
from django.core import mail
from django.template.defaultfilters import date as date_filter
from django.test import TestCase
+from django.test.utils import override_settings
from django.urls import reverse
from django_hosts.resolvers import reverse as django_hosts_reverse
@@ -30,10 +31,12 @@ class TestCampaign(TestCase):
response = self.client.get(self.index_url)
self.assertContains(response, 'Anonymous Hero')
+ @override_settings(MEDIA_ROOT='djangoproject/')
def test_anonymous_donor_with_logo(self):
hero = DjangoHero.objects.create(
is_visible=True, approved=True,
- hero_type='individual', logo='yes') # We don't need an actual image
+ hero_type='individual', logo='static/img/logo-django.png',
+ )
donation = hero.donation_set.create(subscription_amount='5')
donation.payment_set.create(amount='5')
response = self.client.get(self.index_url)