-
Notifications
You must be signed in to change notification settings - Fork 1
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
Sascha Dobbelaere
committed
Jan 2, 2024
1 parent
bd6386c
commit c5939d6
Showing
13 changed files
with
132 additions
and
51 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
...a/contacts/migrations/0005_alter_address_options_alter_invoiceaddress_options_and_more.py
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,25 @@ | ||
# Generated by Django 4.2.6 on 2024-01-02 11:06 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('contacts', '0004_alter_company_options_alter_internalcompany_options_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name='address', | ||
options={'verbose_name_plural': 'addresses'}, | ||
), | ||
migrations.AlterModelOptions( | ||
name='invoiceaddress', | ||
options={'verbose_name_plural': 'invoice addresses'}, | ||
), | ||
migrations.AlterModelOptions( | ||
name='shippingaddress', | ||
options={'verbose_name_plural': 'shipping addresses'}, | ||
), | ||
] |
19 changes: 19 additions & 0 deletions
19
OneSila/core/migrations/0013_alter_multitenantuser_timezone.py
Large diffs are not rendered by default.
Oops, something went wrong.
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,9 +1,14 @@ | ||
from core.models import MultiTenantCompany | ||
from django.contrib.auth import get_user_model | ||
from model_bakery import baker | ||
from django.test import TestCase as DjangoTestCase | ||
|
||
|
||
class TestCaseMixin: | ||
def setUp(self): | ||
self.multi_tenant_company = baker.make(MultiTenantCompany) | ||
self.user = baker.make(get_user_model(), multi_tenant_company=self.multi_tenant_company) | ||
|
||
|
||
class TestCase(TestCaseMixin, DjangoTestCase): | ||
pass |
17 changes: 17 additions & 0 deletions
17
OneSila/inventory/migrations/0002_alter_inventory_options.py
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,17 @@ | ||
# Generated by Django 4.2.6 on 2024-01-02 11:06 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('inventory', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name='inventory', | ||
options={'verbose_name_plural': 'inventories'}, | ||
), | ||
] |
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,20 @@ | ||
# Generated by Django 4.2.6 on 2024-01-02 11:06 | ||
|
||
import core.validators | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('media', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='media', | ||
name='image', | ||
field=models.ImageField(upload_to='images/', validators=[core.validators.validate_image_extension, | ||
core.validators.no_dots_in_filename], verbose_name='Image (High resolution)'), | ||
), | ||
] |
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,28 @@ | ||
from media.models import Media | ||
from core.tests import TestCase | ||
from model_bakery import baker | ||
from django.core.files import File | ||
from django.conf import settings | ||
import os | ||
|
||
|
||
class MediaTestCase(TestCase): | ||
def test_image_web_url_none(self): | ||
image = baker.make(Media, image=None) | ||
url = image.image_web_url() | ||
self.assertTrue(url is None) | ||
|
||
def test_image_web_url(self): | ||
fname = 'red.png' | ||
image_path = os.path.join(settings.BASE_DIR.parent, 'core', 'tests', 'image_files', fname) | ||
image = baker.make(Media) | ||
|
||
with open(image_path, 'rb') as f: | ||
image.image.save(fname, File(f)) | ||
image.full_clean() | ||
image.save() | ||
url = image.image_web_url() | ||
|
||
# Cached images are converted to jpg, no matter what the source. | ||
self.assertTrue(url.endswith('.jpg')) | ||
self.assertTrue(url.startswith('http')) |
This file was deleted.
Oops, something went wrong.
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