<commit_before>from django.test import TestCase
from teams.models import Team
from projects.models import Project, ProjectMembership 
from django.utils import timezone

class project_membership_test(TestCase):
    def setUp(self):
        self.team_name = "Team1"
        self.team_name_2 = "Team2"

        self.project_name = "Project1"
        self.project_name_2 = "Project2"

        self.team = Team.objects.create_team(
            name = self.team_name
        )

        self.team_2 = Team.objects.create_team(
            name = self.team_name_2
        )

        self.project = Project.objects.create_project(
            name = self.project_name,
        )
        
        self.project_2 = Project.objects.create_project(
            name = self.project_name_2,
        )
        
        self.project_membership = ProjectMembership.objects.create(
            project = self.project,
            team = self.team
        )
        self.project_membership.save()
        
    def test_project_could_get_all_team_list(self):
        try:
            self.project.team_list.all()
        except:
            self.fail("getting all team list failed")
    def test_project_could_get_team_list(self):
        try:
            self.project.team_list.get_team(self.team_name)
        except:
            self.fail("getting a team from team list failed")

    def test_project_membership_must_have_date_joined(self):
        try:
            self.project_membership.date_joined
        except AttributeError:
            self.fail("project_membership doesn't  have date_joined")

<commit_msg>team field name applied, mtom manager applied<commit_after>from django.test import TestCase
from teams.models import Team
from projects.models import Project, ProjectMembership 
from django.utils import timezone

class project_membership_test(TestCase):
    def setUp(self):
        self.team_name = "Team1"
        self.second_team = "Team2"

        self.project_name = "Project1"
        self.second_project = "Project2"

        self.team = Team.objects.create_team(
            name = self.team_name
        )

        self.team_2 = Team.objects.create_team(
            name = self.second_team
        )

        self.project = Project.objects.create_project(
            name = self.project_name,
        )
        
        self.project_2 = Project.objects.create_project(
            name = self.second_project,
        )
        
        self.project_membership = ProjectMembership.objects.create_project_membership(
            project = self.project,
            team = self.team
        )
        self.project_membership.save()
        
    def test_project_could_get_all_project_teams(self):
        try:
            self.project.project_teams.all()
        except:
            self.fail("getting all team list failed")
    def test_project_could_get_project_teams(self):
        try:
            self.project.project_teams.get_project_team(self.team.id)
        except:
            self.fail("getting a team from team list failed")

    def test_project_membership_must_have_date_joined(self):
        try:
            self.project_membership.date_joined
        except AttributeError:
            self.fail("project_membership doesn't  have date_joined")


{'fraction_non_alphanumeric': 0.07586417864790455, 'fraction_numerical': 0.004894463138574488, 'mean_word_length': 2.174757281553398, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4045119', 'n_tokens_mistral': 938, 'n_tokens_neox': 920, 'n_words': 174}