Test coverage report: ftp_deploy.server.forms.notification

# ftp_deploy.server.forms.notification: 22 total statements, 100.0% covered

Generated: Thu 2013-12-19 21:13 GMT

Source file: /var/www/service.dev/service/ftp_deploy/server/forms/notification.py

Stats: 16 executed, 0 missed, 6 excluded, 21 ignored

1. `import json`
2. ``
3. `from django import forms`
4. ``
5. `from crispy_forms.helper import FormHelper`
6. `from crispy_forms.bootstrap import FormActions`
7. `from crispy_forms.layout import Layout, Field`
8. ``
9. `from ftp_deploy.models import Notification`
10. ``
11. ``
12. `class NotificationForm(forms.ModelForm):`
13. ``
14. `success = forms.CharField(widget=forms.TextInput(attrs={'size':'150'}),help_text='Comma separated list of emails',required=False)`
15. `fail = forms.CharField(widget=forms.TextInput(attrs={'size':'150'}),help_text='Comma separated list of emails',required=False)`
16. `deploy_user = forms.MultipleChoiceField(widget=forms.CheckboxSelectMultiple(),choices=((0,'Success'),(1,'Fail')), required=False)`
17. `commit_user = forms.MultipleChoiceField(widget=forms.CheckboxSelectMultiple(),choices=((0,'Success'),(1,'Fail')), required=False)`
18. ``
19. `def __init__(self, *args, **kwargs):`
20. `super(NotificationForm, self).__init__(*args, **kwargs)`
21. ``
22. `self.helper_header = FormHelper()`
23. `self.helper_header.html5_required = True`
24. `self.helper_header.form_tag = False`
25. ``
26. `self.helper_header.layout = Layout(`
27. `'name',`
28. `Field('success', type="hidden"),`
29. `Field('fail', type="hidden")`
30. `)`
31. ``
32. `self.helper_user = FormHelper()`
33. `self.helper_user.form_tag = False`
34. ``
35. `self.helper_user.layout = Layout(`
36. `Field('deploy_user', template='ftp_deploy/notification/form-user-field.html'),`
37. `Field('commit_user', template='ftp_deploy/notification/form-user-field.html')`
38. ``
39. `)`
40. ``
41. `class Meta:`
42. `model = Notification`
43. ``