-
Notifications
You must be signed in to change notification settings - Fork 616
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
60 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Generated by Django 2.2.24 on 2023-12-24 18:54 | ||
|
||
import django.core.validators | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('sponsors', '0098_auto_20231219_1910'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='sponsor', | ||
name='print_logo', | ||
field=models.FileField(blank=True, help_text='For printed materials, signage, and projection. SVG or EPS', null=True, upload_to='sponsor_print_logos', validators=[django.core.validators.FileExtensionValidator(['eps', 'epsfepsi', 'svg', 'png'])], verbose_name='Print logo'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
from pathlib import Path | ||
|
||
from django.core.files.uploadedfile import SimpleUploadedFile | ||
from model_bakery import baker | ||
|
||
from django.conf import settings | ||
|
@@ -438,6 +441,21 @@ def test_create_sponsor_with_valid_data_for_non_required_inputs( | |
self.assertEqual(sponsor.landing_page_url, "https://companyx.com") | ||
self.assertEqual(sponsor.twitter_handle, "@companyx") | ||
|
||
def test_create_sponsor_with_svg_for_print_logo( | ||
self, | ||
): | ||
tick_svg = Path(settings.STATICFILES_DIRS[0]) / "img"/"sponsors"/"tick.svg" | ||
with tick_svg.open("rb") as fd: | ||
uploaded_svg = SimpleUploadedFile("tick.svg", fd.read()) | ||
self.files["print_logo"] = uploaded_svg | ||
|
||
form = SponsorshipApplicationForm(self.data, self.files) | ||
self.assertTrue(form.is_valid(), form.errors) | ||
|
||
sponsor = form.save() | ||
|
||
self.assertTrue(sponsor.print_logo) | ||
|
||
def test_use_previous_user_sponsor(self): | ||
contact = baker.make(SponsorContact, user__email="[email protected]") | ||
self.data = {"sponsor": contact.sponsor.id} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters