File diff cadd69061f18 → 3cccc3bdd90e
conservancy/usethesource/tests.py
Show inline comments
...
 
@@ -5,7 +5,7 @@ from django.contrib.auth.models import User
 
import pytest
 

	
 
from . import models
 
from .emails import make_comment_email
 
from .emails import make_candidate_email, make_comment_email
 
from .models import Candidate, Comment
 

	
 

	
...
 
@@ -28,6 +28,17 @@ def test_message_id():
 
    assert re.match(r'<.+@.+>', models.gen_message_id())
 

	
 

	
 
@pytest.mark.django_db
 
def test_candidate_email():
 
    user = User.objects.create(first_name='Test', last_name='User')
 
    candidate = make_candidate(name='Test Candidate', save=True)
 
    email = make_candidate_email(candidate, user)
 
    assert 'Message-ID' in email.extra_headers
 
    assert email.subject == 'Test Candidate'
 
    assert 'Test Candidate' in email.body
 
    assert 'Test User' in email.body
 

	
 

	
 
@pytest.mark.django_db
 
def test_comment_knows_comment_its_replying_to():
 
    user = User.objects.create()