<commit_before>from django.test import TestCase
from django.contrib.auth.models import User
from approver.models import Person,Project
from approver.workflows import project_crud

class ProjectWorkFlowTestCase(TestCase):
	def setUp(self):
		"""
		Create test data for user,person,project for testing project_crud workflow.
		"""
		self.user = User(username='testuser')
		self.user.save()
		self.person = Person(user= self.user,first_name = 'first', last_name = 'last', email_address = 'email')
		self.person.save(last_modified_by=self.user)
		self.project = Project(title = "testproj", owner = self.person)
		self.project.save(last_modified_by=self.user)

	def test_get_project_should_not_return_none(self):
		projects = Project.objects.all()
		for project in projects:
			self.assertNotEqual(project_crud.get_project_or_none(project.id),None)

	def test_get_project_should_return_none(self):
		self.assertEquals(project_crud.get_project_or_none(-1),None)

	def test_project_should_exists(self):
		projects = Project.objects.all()
		for project in projects:
			self.assertEquals(project_crud.project_exists(project.id),True)

	def test_project_exists(self):
		self.assertEquals(project_crud.project_exists(-1),False)

	def test_curent_user_is_project_owner(self):
		self.assertTrue(project_crud.curent_user_is_project_owner(self.user,self.project))

	def test_current_user_is_project_advisor_or_collaborator(self):
		self.assertFalse(project_crud.current_user_is_project_advisor_or_collaborator(self.user,self.project))

	def test_current_user_can_perform_project_delete(self):
		self.assertTrue(project_crud.current_user_can_perform_project_delete(self.user,self.project))
<commit_msg>update tests to new function name<commit_after>from django.test import TestCase
from django.contrib.auth.models import User
from approver.models import Person,Project
from approver.workflows import project_crud

class ProjectWorkFlowTestCase(TestCase):
	def setUp(self):
		"""
		Create test data for user,person,project for testing project_crud workflow.
		"""
		self.user = User(username='testuser')
		self.user.save()
		self.person = Person(user= self.user,first_name = 'first', last_name = 'last', email_address = 'email')
		self.person.save(last_modified_by=self.user)
		self.project = Project(title = "testproj", owner = self.person)
		self.project.save(last_modified_by=self.user)

	def test_get_project_should_not_return_none(self):
		projects = Project.objects.all()
		for project in projects:
			self.assertNotEqual(project_crud.get_project_or_none(project.id),None)

	def test_get_project_should_return_none(self):
		self.assertEquals(project_crud.get_project_or_none(-1),None)

	def test_project_should_exists(self):
		projects = Project.objects.all()
		for project in projects:
			self.assertEquals(project_crud.project_exists(project.id),True)

	def test_project_exists(self):
		self.assertEquals(project_crud.project_exists(-1),False)

	def test_current_user_is_project_owner(self):
		self.assertTrue(project_crud.current_user_is_project_owner(self.user,self.project))

	def test_current_user_is_project_advisor_or_collaborator(self):
		self.assertFalse(project_crud.current_user_is_project_advisor_or_collaborator(self.user,self.project))

	def test_current_user_can_perform_project_delete(self):
		self.assertTrue(project_crud.current_user_can_perform_project_delete(self.user,self.project))

{'fraction_non_alphanumeric': 0.09899823217442545, 'fraction_numerical': 0.0011785503830288745, 'mean_word_length': 7.445273631840796, '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': '4625413', 'n_tokens_mistral': 1162, 'n_tokens_neox': 1103, 'n_words': 165}