• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

gcivil-nyu-org / INT2-Monday-Spring2024-Team-2 / 719

15 Apr 2024 04:27PM UTC coverage: 90.674%. Remained the same
719

push

travis-pro

web-flow
Merge pull request #237 from gcivil-nyu-org/feature-shihui

exempt contact from middleware

1 of 1 new or added line in 1 file covered. (100.0%)

713 existing lines in 14 files now uncovered.

1789 of 1973 relevant lines covered (90.67%)

1.23 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/Community/forms.py
1
from django import forms
2✔
2
from TutorRegister.models import Post, Reply
2✔
3
from TutorRegister.presets import EXPERTISE_CHOICES
2✔
4

5

6
class CreatePostForm(forms.ModelForm):
2✔
7
    class Meta:
2✔
8
        model = Post
2✔
9

10
        fields = ["title", "content", "label", "attachment", "topics"]
2✔
11

12
        labels = {
2✔
13
            "title": "Title",
14
            "content": "Content",
15
            "label": "Label",
16
            "attachment": "Attachment",
17
            "topics": "Topic",
18
        }
19

20
        widgets = {
2✔
21
            "title": forms.TextInput(attrs={"class": "form-control"}),
22
            "content": forms.Textarea(attrs={"class": "form-control"}),
23
            "label": forms.RadioSelect(attrs={"class": "form-check-input"}),
24
            "attachment": forms.FileInput(attrs={"class": "form-control-file"}),
25
            "topics": forms.Select(attrs={"class": "form-control"}),
26
        }
27

28
    def __init__(self, *args, **kwargs):
2✔
UNCOV
29
        super(CreatePostForm, self).__init__(*args, **kwargs)
1✔
30

UNCOV
31
        self.fields["label"].choices = [
1✔
32
            ("resource", "Resource"),
33
            ("question", "Question"),
34
        ]
35

UNCOV
36
        self.fields["topics"] = forms.ChoiceField(
1✔
37
            choices=EXPERTISE_CHOICES,
38
            widget=self.Meta.widgets["topics"],
39
            required=False,
40
        )
41

42

43
class CreateReplyForm(forms.ModelForm):
2✔
44
    class Meta:
2✔
45
        model = Reply
2✔
46

47
        fields = ["content"]
2✔
48

49
        labels = {"content": "Content"}
2✔
50

51
        widgets = {"content": forms.Textarea(attrs={"class": "form-control"})}
2✔
52

53

54
# class SearchFilterForm(forms.Form):
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc