Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Why is my Writer class test not passing?
Just wondering why my Writer model class test is not passing on line 13.
from django.test import TestCase from .models import Writer class WriterModelTestCase(TestCase): '''Tests for the Writer model''' def writer_email_test(self): writer = Writer.objects.create( name="joseph", email="email@example.com", bio="Hello World" ) e_address = self.writer.mailto() self.assertIn("firstname.lastname@example.org", e_address)
Chris FreemanTreehouse Moderator 68,404 Points
While your code is technically correct, the task is specifically look for:
Task 2 of 2: Now add a test that creates an instance of the Writer model and, using self.assertIn,
make sure the email attribute
is in the output of the mailto()
For this to pass, all three aspects need to be on the same line: