Merge pull request #2646 from anoek/2628

Better handle missing notification_type in patches to notification template
This commit is contained in:
Akita Noek
2016-06-27 10:47:04 -04:00
committed by GitHub
2 changed files with 18 additions and 1 deletions

View File

@@ -104,3 +104,11 @@ def test_notification_template_merging(get, post, user, organization, project, n
organization.notification_templates_any.add(notification_template)
project.notification_templates_any.add(notification_template)
assert len(project.notification_templates['any']) == 1
@pytest.mark.django_db
def test_notification_template_simple_patch(patch, notification_template, admin):
patch(reverse('api:notification_template_detail', args=(notification_template.id,)), { 'name': 'foo'}, admin, expect=200)
@pytest.mark.django_db
def test_notification_template_invalid_notification_type(patch, notification_template, admin):
patch(reverse('api:notification_template_detail', args=(notification_template.id,)), { 'notification_type': 'invalid'}, admin, expect=400)