@@ -0,0 +1,1571 @@
+from django.test import TestCase%0Afrom teams.models import Team%0Afrom projects.models import Project, ProjectMembership %0Afrom django.utils import timezone%0A%0Aclass project_membership_test(TestCase):%0A    def setUp(self):%0A        self.team_name = %22Team1%22%0A        self.team_name_2 = %22Team2%22%0A%0A        self.project_name = %22Project1%22%0A        self.project_name_2 = %22Project2%22%0A%0A        self.team = Team.objects.create_team(%0A            name = self.team_name%0A        )%0A%0A        self.team_2 = Team.objects.create_team(%0A            name = self.team_name_2%0A        )%0A%0A        self.project = Project.objects.create_project(%0A            name = self.project_name,%0A        )%0A        %0A        self.project_2 = Project.objects.create_project(%0A            name = self.project_name_2,%0A        )%0A        %0A        self.project_membership = ProjectMembership.objects.create(%0A            project = self.project,%0A            team = self.team%0A        )%0A        self.project_membership.save()%0A        %0A    def test_project_could_get_all_team_list(self):%0A        try:%0A            self.project.team_list.all()%0A        except:%0A            self.fail(%22getting all team list failed%22)%0A    def test_project_could_get_team_list(self):%0A        try:%0A            self.project.team_list.get_team(self.team_name)%0A        except:%0A            self.fail(%22getting a team from team list failed%22)%0A%0A    def test_project_membership_must_have_date_joined(self):%0A        try:%0A            self.project_membership.date_joined%0A        except AttributeError:%0A            self.fail(%22project_membership doesn't  have date_joined%22)%0A%0A

test membership_project_to_team