from django.contrib.auth.models import User
from django.test import TestCase

from volunteers.models import Volunteer, VolunteerComplementaryContact


class VolunteerTestCase(TestCase):
    def setUp(self):

        self.user = User.objects.create_user(
            username='refood', email='test@refood-non-profit.org', password='top_secret')

        volunteer = Volunteer.objects.create(user=self.user, car_availability=True)

        self.volunteer_complementary_contact = \
            VolunteerComplementaryContact.objects.create(volunteer=volunteer, first_name='Cascais', last_name='CPR',
                                                         contact_type=VolunteerComplementaryContact.ICE)

    def test_Volunteer_str(self):
        self.assertEqual(str(self.user.volunteer), self.user.get_username())

        self.user.first_name = 'Re'
        self.user.last_name = 'Food'
        self.user.save()

        self.assertEqual(str(self.user.volunteer), self.user.get_full_name())

    def test_VolunteerComplementaryContact_str(self):
        self.assertEqual(str(self.user.volunteer.volunteer_complementary_contact_list.first()),
                         self.user.get_username() + ' - ' + self.volunteer_complementary_contact.first_name + ' ' +
                         self.volunteer_complementary_contact.last_name)

@@ -114,39 +114,8 @@
 teer
-, VolunteerComplementaryContact
 %0A%0A%0Ac
@@ -310,28 +310,15 @@
 t')%0A
-%0A
        
- volunteer =
  Vol
@@ -383,280 +383,8 @@
 e)%0A%0A
-        self.volunteer_complementary_contact = %5C%0A            VolunteerComplementaryContact.objects.create(volunteer=volunteer, first_name='Cascais', last_name='CPR',%0A                                                         contact_type=VolunteerComplementaryContact.ICE)%0A%0A
     
@@ -672,344 +672,4 @@
 ())%0A
-%0A    def test_VolunteerComplementaryContact_str(self):%0A        self.assertEqual(str(self.user.volunteer.volunteer_complementary_contact_list.first()),%0A                         self.user.get_username() + ' - ' + self.volunteer_complementary_contact.first_name + ' ' +%0A                         self.volunteer_complementary_contact.last_name)%0A

Remove bug in Tests