Skip to content

Commit 4301555

Browse files
authored
Merge pull request #421 from CrisKrus/419-add-allies-to-fixtures
test: add allies fixtures
2 parents 419ba2b + 74596c6 commit 4301555

3 files changed

Lines changed: 33 additions & 0 deletions

File tree

apps/dev/fixtures/adalovedev.jpg

38.8 KB
Loading

apps/dev/fixtures/python-es.png

43.7 KB
Loading

apps/dev/management/commands/dbload.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from django.conf import settings
55
from django.core.files.uploadedfile import UploadedFile
66
from django.core.management.base import BaseCommand
7+
from apps.about.models import Ally
78

89
from apps.locations.models import Venue
910
from apps.organizations.models import Organization
@@ -52,6 +53,37 @@ def add_own_organization():
5253
).save()
5354

5455

56+
def add_allies():
57+
"""
58+
Add the Python Canarias allies, in order to work with this section
59+
"""
60+
print("Adding allies")
61+
62+
photo_path = Path(settings.BASE_DIR) / 'apps/dev/fixtures/adalovedev.jpg'
63+
with photo_path.open('rb') as fin:
64+
photo = UploadedFile(fin, name=photo_path.name)
65+
Ally(
66+
name='AdaLoveDev',
67+
description='Somos una comunidad sin ánimo de lucro cuyo objetivo es dar visibilidad y empoderamiento a las mujeres en el sector tecnológico',
68+
logo=photo,
69+
url='https://adalovedev.es/',
70+
twitter='https://twitter.com/adalovedev',
71+
email='organization@adalovedev.es',
72+
).save()
73+
74+
photo_path = Path(settings.BASE_DIR) / 'apps/dev/fixtures/python-es.png'
75+
with photo_path.open('rb') as fin:
76+
photo = UploadedFile(fin, name=photo_path.name)
77+
Ally(
78+
name='Python España',
79+
description='Asociación Python España. Trabajando para promover y visibilizar el uso del lenguaje de programación Python en nuestro país',
80+
logo=photo,
81+
url='https://www.es.python.org/',
82+
twitter='https://twitter.com/python_es',
83+
email=' contacto@es.python.org',
84+
).save()
85+
86+
5587
def add_events():
5688
"""
5789
Add a sample value and event so we get some content in the events page
@@ -98,3 +130,4 @@ def handle(self, *args, **options):
98130
add_own_organization()
99131
add_quotes()
100132
add_events()
133+
add_allies()

0 commit comments

Comments
 (0)