Princeton-CDH / mep-django

@@ -551,7 +551,7 @@
Loading
551 551
        assert 'member' in data
552 552
        assert 'subscription' in data
553 553
554 -
        # test separate deposit gets subscription info
554 +
        # test separate payment event includes subscription info
555 555
        sub = event.subscription
556 556
        sub.subtype = 'oth'
557 557
        sub.save()

@@ -0,0 +1,43 @@
Loading
1 +
# Generated by Django 2.2.17 on 2021-08-04 20:14
2 +
3 +
from django.db import migrations
4 +
import wagtail.core.blocks
5 +
import wagtail.core.fields
6 +
import wagtail.documents.blocks
7 +
import wagtail.embeds.blocks
8 +
import wagtail.images.blocks
9 +
10 +
11 +
class Migration(migrations.Migration):
12 +
13 +
    dependencies = [
14 +
        ('pages', '0011_updated_streamfield_blocks'),
15 +
    ]
16 +
17 +
    operations = [
18 +
        migrations.AlterField(
19 +
            model_name='contentlandingpage',
20 +
            name='body',
21 +
            field=wagtail.core.fields.StreamField([('paragraph', wagtail.core.blocks.RichTextBlock(features=['h2', 'h3', 'h4', 'bold', 'italic', 'link', 'ol', 'ul', 'hr', 'blockquote', 'document', 'superscript', 'subscript', 'strikethrough', 'code'])), ('image', wagtail.core.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock()), ('alternative_text', wagtail.core.blocks.TextBlock(help_text='Alternative text for visually impaired users to\nbriefly communicate the intended message of the image in this context.', required=True)), ('caption', wagtail.core.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'superscript'], required=False))])), ('svg_image', wagtail.core.blocks.StructBlock([('image', wagtail.documents.blocks.DocumentChooserBlock()), ('alternative_text', wagtail.core.blocks.TextBlock(help_text='Alternative text for visually impaired users to\nbriefly communicate the intended message of the image in this context.', required=True)), ('caption', wagtail.core.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'superscript'], required=False)), ('extended_description', wagtail.core.blocks.RichTextBlock(features=['p'], help_text='This text will only be read to     non-sighted users and should describe the major insights or     takeaways from the graphic. Multiple paragraphs are allowed.', required=False))])), ('document', wagtail.documents.blocks.DocumentChooserBlock()), ('footnotes', wagtail.core.blocks.RichTextBlock(classname='footnotes', features=['ol', 'ul', 'bold', 'italic', 'link'])), ('linkable_section', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.CharBlock()), ('anchor_text', wagtail.core.blocks.CharBlock(help_text='Short label for anchor link')), ('body', wagtail.core.blocks.RichTextBlock(features=['h3', 'h4', 'bold', 'italic', 'link', 'ol', 'ul', 'hr', 'blockquote', 'document', 'superscript', 'subscript', 'strikethrough', 'code']))])), ('embed', wagtail.embeds.blocks.EmbedBlock())], blank=True),
22 +
        ),
23 +
        migrations.AlterField(
24 +
            model_name='contentpage',
25 +
            name='body',
26 +
            field=wagtail.core.fields.StreamField([('paragraph', wagtail.core.blocks.RichTextBlock(features=['h2', 'h3', 'h4', 'bold', 'italic', 'link', 'ol', 'ul', 'hr', 'blockquote', 'document', 'superscript', 'subscript', 'strikethrough', 'code'])), ('image', wagtail.core.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock()), ('alternative_text', wagtail.core.blocks.TextBlock(help_text='Alternative text for visually impaired users to\nbriefly communicate the intended message of the image in this context.', required=True)), ('caption', wagtail.core.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'superscript'], required=False))])), ('svg_image', wagtail.core.blocks.StructBlock([('image', wagtail.documents.blocks.DocumentChooserBlock()), ('alternative_text', wagtail.core.blocks.TextBlock(help_text='Alternative text for visually impaired users to\nbriefly communicate the intended message of the image in this context.', required=True)), ('caption', wagtail.core.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'superscript'], required=False)), ('extended_description', wagtail.core.blocks.RichTextBlock(features=['p'], help_text='This text will only be read to     non-sighted users and should describe the major insights or     takeaways from the graphic. Multiple paragraphs are allowed.', required=False))])), ('document', wagtail.documents.blocks.DocumentChooserBlock()), ('footnotes', wagtail.core.blocks.RichTextBlock(classname='footnotes', features=['ol', 'ul', 'bold', 'italic', 'link'])), ('linkable_section', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.CharBlock()), ('anchor_text', wagtail.core.blocks.CharBlock(help_text='Short label for anchor link')), ('body', wagtail.core.blocks.RichTextBlock(features=['h3', 'h4', 'bold', 'italic', 'link', 'ol', 'ul', 'hr', 'blockquote', 'document', 'superscript', 'subscript', 'strikethrough', 'code']))])), ('embed', wagtail.embeds.blocks.EmbedBlock())]),
27 +
        ),
28 +
        migrations.AlterField(
29 +
            model_name='essaylandingpage',
30 +
            name='body',
31 +
            field=wagtail.core.fields.StreamField([('paragraph', wagtail.core.blocks.RichTextBlock(features=['h2', 'h3', 'h4', 'bold', 'italic', 'link', 'ol', 'ul', 'hr', 'blockquote', 'document', 'superscript', 'subscript', 'strikethrough', 'code'])), ('image', wagtail.core.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock()), ('alternative_text', wagtail.core.blocks.TextBlock(help_text='Alternative text for visually impaired users to\nbriefly communicate the intended message of the image in this context.', required=True)), ('caption', wagtail.core.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'superscript'], required=False))])), ('svg_image', wagtail.core.blocks.StructBlock([('image', wagtail.documents.blocks.DocumentChooserBlock()), ('alternative_text', wagtail.core.blocks.TextBlock(help_text='Alternative text for visually impaired users to\nbriefly communicate the intended message of the image in this context.', required=True)), ('caption', wagtail.core.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'superscript'], required=False)), ('extended_description', wagtail.core.blocks.RichTextBlock(features=['p'], help_text='This text will only be read to     non-sighted users and should describe the major insights or     takeaways from the graphic. Multiple paragraphs are allowed.', required=False))])), ('document', wagtail.documents.blocks.DocumentChooserBlock()), ('footnotes', wagtail.core.blocks.RichTextBlock(classname='footnotes', features=['ol', 'ul', 'bold', 'italic', 'link'])), ('linkable_section', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.CharBlock()), ('anchor_text', wagtail.core.blocks.CharBlock(help_text='Short label for anchor link')), ('body', wagtail.core.blocks.RichTextBlock(features=['h3', 'h4', 'bold', 'italic', 'link', 'ol', 'ul', 'hr', 'blockquote', 'document', 'superscript', 'subscript', 'strikethrough', 'code']))])), ('embed', wagtail.embeds.blocks.EmbedBlock())], blank=True),
32 +
        ),
33 +
        migrations.AlterField(
34 +
            model_name='essaypage',
35 +
            name='body',
36 +
            field=wagtail.core.fields.StreamField([('paragraph', wagtail.core.blocks.RichTextBlock(features=['h2', 'h3', 'h4', 'bold', 'italic', 'link', 'ol', 'ul', 'hr', 'blockquote', 'document', 'superscript', 'subscript', 'strikethrough', 'code'])), ('image', wagtail.core.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock()), ('alternative_text', wagtail.core.blocks.TextBlock(help_text='Alternative text for visually impaired users to\nbriefly communicate the intended message of the image in this context.', required=True)), ('caption', wagtail.core.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'superscript'], required=False))])), ('svg_image', wagtail.core.blocks.StructBlock([('image', wagtail.documents.blocks.DocumentChooserBlock()), ('alternative_text', wagtail.core.blocks.TextBlock(help_text='Alternative text for visually impaired users to\nbriefly communicate the intended message of the image in this context.', required=True)), ('caption', wagtail.core.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'superscript'], required=False)), ('extended_description', wagtail.core.blocks.RichTextBlock(features=['p'], help_text='This text will only be read to     non-sighted users and should describe the major insights or     takeaways from the graphic. Multiple paragraphs are allowed.', required=False))])), ('document', wagtail.documents.blocks.DocumentChooserBlock()), ('footnotes', wagtail.core.blocks.RichTextBlock(classname='footnotes', features=['ol', 'ul', 'bold', 'italic', 'link'])), ('linkable_section', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.CharBlock()), ('anchor_text', wagtail.core.blocks.CharBlock(help_text='Short label for anchor link')), ('body', wagtail.core.blocks.RichTextBlock(features=['h3', 'h4', 'bold', 'italic', 'link', 'ol', 'ul', 'hr', 'blockquote', 'document', 'superscript', 'subscript', 'strikethrough', 'code']))])), ('embed', wagtail.embeds.blocks.EmbedBlock())]),
37 +
        ),
38 +
        migrations.AlterField(
39 +
            model_name='homepage',
40 +
            name='body',
41 +
            field=wagtail.core.fields.StreamField([('paragraph', wagtail.core.blocks.RichTextBlock(features=['h2', 'h3', 'h4', 'bold', 'italic', 'link', 'ol', 'ul', 'hr', 'blockquote', 'document', 'superscript', 'subscript', 'strikethrough', 'code'])), ('image', wagtail.core.blocks.StructBlock([('image', wagtail.images.blocks.ImageChooserBlock()), ('alternative_text', wagtail.core.blocks.TextBlock(help_text='Alternative text for visually impaired users to\nbriefly communicate the intended message of the image in this context.', required=True)), ('caption', wagtail.core.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'superscript'], required=False))])), ('svg_image', wagtail.core.blocks.StructBlock([('image', wagtail.documents.blocks.DocumentChooserBlock()), ('alternative_text', wagtail.core.blocks.TextBlock(help_text='Alternative text for visually impaired users to\nbriefly communicate the intended message of the image in this context.', required=True)), ('caption', wagtail.core.blocks.RichTextBlock(features=['bold', 'italic', 'link', 'superscript'], required=False)), ('extended_description', wagtail.core.blocks.RichTextBlock(features=['p'], help_text='This text will only be read to     non-sighted users and should describe the major insights or     takeaways from the graphic. Multiple paragraphs are allowed.', required=False))])), ('document', wagtail.documents.blocks.DocumentChooserBlock()), ('footnotes', wagtail.core.blocks.RichTextBlock(classname='footnotes', features=['ol', 'ul', 'bold', 'italic', 'link'])), ('linkable_section', wagtail.core.blocks.StructBlock([('title', wagtail.core.blocks.CharBlock()), ('anchor_text', wagtail.core.blocks.CharBlock(help_text='Short label for anchor link')), ('body', wagtail.core.blocks.RichTextBlock(features=['h3', 'h4', 'bold', 'italic', 'link', 'ol', 'ul', 'hr', 'blockquote', 'document', 'superscript', 'subscript', 'strikethrough', 'code']))])), ('embed', wagtail.embeds.blocks.EmbedBlock())]),
42 +
        ),
43 +
    ]

@@ -0,0 +1,19 @@
Loading
1 +
# Generated by Django 2.2.17 on 2021-08-04 20:14
2 +
3 +
from django.db import migrations, models
4 +
import django.db.models.deletion
5 +
6 +
7 +
class Migration(migrations.Migration):
8 +
9 +
    dependencies = [
10 +
        ('footnotes', '0005_consolidate_event_footnotes'),
11 +
    ]
12 +
13 +
    operations = [
14 +
        migrations.AlterField(
15 +
            model_name='footnote',
16 +
            name='content_type',
17 +
            field=models.ForeignKey(limit_choices_to=models.Q(models.Q(('app_label', 'people'), ('model__in', ['country', 'person', 'address', 'profession'])), models.Q(('app_label', 'accounts'), ('model__in', ['account', 'event'])), models.Q(('app_label', 'books'), ('model__in', ['work'])), _connector='OR'), on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType'),
18 +
        ),
19 +
    ]

@@ -74,7 +74,7 @@
Loading
74 74
75 75
        # subscription-specific data
76 76
        if event_type in ['Subscription', 'Supplement', 'Renewal',
77 -
                          'Separate Deposit']:
77 +
                          'Separate Payment']:
78 78
            data['subscription'] = self.subscription_info(obj)
79 79
            currency = obj.subscription.currency
80 80

@@ -0,0 +1,18 @@
Loading
1 +
# Generated by Django 2.2.17 on 2021-08-04 20:14
2 +
3 +
from django.db import migrations, models
4 +
5 +
6 +
class Migration(migrations.Migration):
7 +
8 +
    dependencies = [
9 +
        ('accounts', '0035_merge_20201210_1240'),
10 +
    ]
11 +
12 +
    operations = [
13 +
        migrations.AlterField(
14 +
            model_name='subscription',
15 +
            name='subtype',
16 +
            field=models.CharField(blank=True, choices=[('', 'Subscription'), ('sup', 'Supplement'), ('ren', 'Renewal'), ('oth', 'Separate Payment')], help_text='Type of subscription event, e.g. supplement or renewal.', max_length=50, verbose_name='Type'),
17 +
        ),
18 +
    ]

@@ -1,4 +1,4 @@
Loading
1 -
__version_info__ = (1, 5, 1, None)
1 +
__version_info__ = (1, 5, 2, None)
2 2
3 3
4 4
# Dot-connect all but the last. Last is dash-connected if not None.

@@ -0,0 +1,23 @@
Loading
1 +
# Generated by Django 2.2.17 on 2021-08-04 20:14
2 +
3 +
from django.db import migrations, models
4 +
5 +
6 +
class Migration(migrations.Migration):
7 +
8 +
    dependencies = [
9 +
        ('people', '0019_pastpersonslug'),
10 +
    ]
11 +
12 +
    operations = [
13 +
        migrations.AlterField(
14 +
            model_name='person',
15 +
            name='public_notes',
16 +
            field=models.TextField(blank=True, help_text='Notes for display on the public site. Use markdown for formatting.'),
17 +
        ),
18 +
        migrations.AlterField(
19 +
            model_name='person',
20 +
            name='slug',
21 +
            field=models.SlugField(help_text='Short, unique identifier for public URL. Recommended format: lastname-firstname (lastname only if unique)', max_length=100, unique=True),
22 +
        ),
23 +
    ]

@@ -450,13 +450,13 @@
Loading
450 450
451 451
    SUPPLEMENT = 'sup'
452 452
    RENEWAL = 'ren'
453 -
    SEPARATE_DEPOSIT = 'oth'  # for historical reasons, this code is "other"
453 +
    SEPARATE_PAYMENT = 'oth'  # for historical reasons, this code is "other"
454 454
455 455
    EVENT_TYPE_CHOICES = (
456 456
        ('', 'Subscription'),
457 457
        (SUPPLEMENT, 'Supplement'),
458 458
        (RENEWAL, 'Renewal'),
459 -
        (SEPARATE_DEPOSIT, 'Separate Deposit'),
459 +
        (SEPARATE_PAYMENT, 'Separate Payment'),
460 460
    )
461 461
    subtype = models.CharField(
462 462
        verbose_name='Type', max_length=50, blank=True,
@@ -470,8 +470,6 @@
Loading
470 470
            self.duration = self.calculate_duration()
471 471
        super(Subscription, self).save(*args, **kwargs)
472 472
473 -
474 -
475 473
    def validate_unique(self, *args, **kwargs):
476 474
        '''Validation check to prevent duplicate events from being
477 475
        added to the system.  Does not allow more than one subscription
@@ -612,11 +610,13 @@
Loading
612 610
        `unique_together` because of multi-table inheritance.'''
613 611
        super(Reimbursement, self).validate_unique(*args, **kwargs)
614 612
615 -
        # check to prevent duplicate event (reimbursement + date + account)
616 -
        # should not have same date + account
613 +
        # check to prevent duplicate event;
614 +
        # reimbursement + date + account + refund amount
615 +
        # should not have same date + account + amount
617 616
        try:
618 617
            qs = Reimbursement.objects.filter(start_date=self.start_date,
619 -
                                              account=self.account)
618 +
                                              account=self.account,
619 +
                                              refund=self.refund)
620 620
        except ObjectDoesNotExist:
621 621
            # bail out without making any further assertions because
622 622
            # we've had a missing related field and other checks

@@ -975,10 +975,11 @@
Loading
975 975
        # resaving existing record should not error
976 976
        self.reimbursement.validate_unique()
977 977
978 -
        # creating new reimbursement for same account & date should error
978 +
        # creating new reimbursement for same account & date & amount should error
979 979
        with pytest.raises(ValidationError):
980 980
            reimburse = Reimbursement(account=self.account,
981 -
                start_date=self.reimbursement.start_date)
981 +
                start_date=self.reimbursement.start_date,
982 +
                refund=self.reimbursement.refund)
982 983
            reimburse.validate_unique()
983 984
984 985
        # a new reimbursement that is not on the same date should not be caught
@@ -986,7 +987,13 @@
Loading
986 987
            start_date=datetime.date(1919, 1, 1))
987 988
        reimburse.validate_unique()
988 989
989 -
        # a reimbursement withment without an account should not raise
990 +
        # same account, same day, different refund amount is allowed
991 +
        reimburse2 = Reimbursement(account=self.account,
992 +
            start_date=self.reimbursement.start_date,
993 +
            refund=100)
994 +
        reimburse.validate_unique()
995 +
996 +
        # a reimbursement without an account should not raise
990 997
        # a related object error
991 998
        Reimbursement().validate_unique()
992 999
Files Coverage
mep 98.43%
srcmedia/ts 86.55%
manage.py 0.00%
Project Totals (233 files) 97.91%
1125434368
typescript
1125434275
typescript
1125434368
python
1125434275
python

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading