SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit beedaa61 authored by George Katsikas's avatar George Katsikas :goat:
Browse files

change proofsrepo tests to dynamic name

parent 94edbb42
No related branches found
No related tags found
1 merge request!56Fix gitlab race conditions with repo creation
......@@ -130,7 +130,10 @@ class TestProofRepository(TestCase):
stream__submission__preprint__identifier_w_vn_nr="scipost_202101_00001v1"
)
self.assertEqual(proofs_repo.name, "scipost_202101_00001v1_User")
self.assertEqual(
ProofsRepository._get_repo_name(proofs_repo.stream),
"scipost_202101_00001v1_User",
)
def test_repo_name_nonexisting_profile(self):
proofs_repo = ProofsRepository.objects.get(
......@@ -140,7 +143,10 @@ class TestProofRepository(TestCase):
# delete profile
Contributor.objects.get(user__username="testuser").profile.delete()
self.assertEqual(proofs_repo.name, "scipost_202101_00001v1_User")
self.assertEqual(
ProofsRepository._get_repo_name(proofs_repo.stream),
"scipost_202101_00001v1_User",
)
def test_repo_name_double_last_name_profile(self):
proofs_repo = ProofsRepository.objects.get(
......@@ -153,7 +159,10 @@ class TestProofRepository(TestCase):
user_profile.last_name = "Usable User"
user_profile.save()
self.assertEqual(proofs_repo.name, "scipost_202101_00001v1_Usable-User")
self.assertEqual(
ProofsRepository._get_repo_name(proofs_repo.stream),
"scipost_202101_00001v1_Usable-User",
)
def test_repo_name_two_authors(self):
proofs_repo = ProofsRepository.objects.get(
......@@ -164,7 +173,10 @@ class TestProofRepository(TestCase):
"Another Personable Person, Test Usable User"
)
self.assertEqual(proofs_repo.name, "scipost_202101_00001v1_Person")
self.assertEqual(
ProofsRepository._get_repo_name(proofs_repo.stream),
"scipost_202101_00001v1_Person",
)
def test_repo_name_accented_authors(self):
proofs_repo = ProofsRepository.objects.get(
......@@ -178,7 +190,10 @@ class TestProofRepository(TestCase):
proofs_repo.stream.submission.author_list = "Some Pérsønüsær (陈)"
self.assertEqual(proofs_repo.name, "scipost_202101_00001v1_Personusaer")
self.assertEqual(
ProofsRepository._get_repo_name(proofs_repo.stream),
"scipost_202101_00001v1_Personusaer",
)
def test_repo_paths_scipostphys(self):
proofs_repo = ProofsRepository.objects.get(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment