diff options
Diffstat (limited to 'alphabetlearning')
-rw-r--r-- | alphabetlearning/resources/migrations/0002_resource_price.py | 18 | ||||
-rw-r--r-- | alphabetlearning/resources/models.py | 14 | ||||
-rw-r--r-- | alphabetlearning/resources/tests/test_forms.py | 2 |
3 files changed, 26 insertions, 8 deletions
diff --git a/alphabetlearning/resources/migrations/0002_resource_price.py b/alphabetlearning/resources/migrations/0002_resource_price.py new file mode 100644 index 0000000..899be2c --- /dev/null +++ b/alphabetlearning/resources/migrations/0002_resource_price.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.4 on 2025-01-06 17:13 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('resources', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='resource', + name='price', + field=models.DecimalField(decimal_places=2, default=0.0, max_digits=6), + ), + ] diff --git a/alphabetlearning/resources/models.py b/alphabetlearning/resources/models.py index 6881483..f5c3223 100644 --- a/alphabetlearning/resources/models.py +++ b/alphabetlearning/resources/models.py @@ -38,13 +38,13 @@ DESC_HELP_TEXT = """ class Resource(models.Model): name = models.CharField(max_length=255, null=False) stripe_product_id = models.CharField(max_length=100) - # price = models.DecimalField( - # max_digits=6, - # decimal_places=2, - # default=0.00, - # null=False, - # blank=False, - # ) + price = models.DecimalField( + max_digits=6, + decimal_places=2, + default=0.00, + null=False, + blank=False, + ) thumbnail_filenames = models.JSONField( null=False, verbose_name="Thumbnail filenames", diff --git a/alphabetlearning/resources/tests/test_forms.py b/alphabetlearning/resources/tests/test_forms.py index 66d6d43..465dc58 100644 --- a/alphabetlearning/resources/tests/test_forms.py +++ b/alphabetlearning/resources/tests/test_forms.py @@ -53,7 +53,7 @@ class ResourceCreateFormTest(TestCase): @pytest.mark.django_db() def test_featured_slots_must_be_unique(self): - r1 = ResourceModelFactory(feature_slot=1) + _ = ResourceModelFactory(feature_slot=1) with pytest.raises(IntegrityError): ResourceModelFactory(feature_slot=1) |