Skip to content

Commit

Permalink
fix tests, fix google oauth
Browse files Browse the repository at this point in the history
  • Loading branch information
jefer94 committed Dec 23, 2024
1 parent 898b2fb commit 839b75f
Show file tree
Hide file tree
Showing 12 changed files with 515 additions and 200 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import random

import capyc.pytest as capy
import pytest

Expand Down Expand Up @@ -42,9 +40,9 @@ def test_nothing_happens(
@pytest.mark.parametrize(
"github_url, username, repo",
[
("https://github.com/user1/repo1", "user1", "repo1"),
("https://github.com/user2/repo2", "user2", "repo2"),
("https://github.com/user3/repo3", "user3", "repo3"),
("https://github.com/breatheco-de/repo1", "breatheco-de", "repo1"),
("https://github.com/4GeeksAcademy/repo2", "4GeeksAcademy", "repo2"),
("https://github.com/4geeksacademy/repo3", "4geeksacademy", "repo3"),
],
)
def test_schedule_repository_deletion(
Expand Down Expand Up @@ -77,5 +75,6 @@ def test_schedule_repository_deletion(
"status": "PENDING",
"status_text": None,
"starts_transferring_at": None,
"notified_at": None,
},
]
5 changes: 5 additions & 0 deletions breathecode/authenticate/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,11 @@ def get_or_create(cls, user, token_type: str, **kwargs: Unpack[TokenGetOrCreateA

return token, created

@classmethod
@sync_to_async
def aget_or_create(cls, user, token_type: str, **kwargs: Unpack[TokenGetOrCreateArgs]) -> Tuple["Token", bool]:
return cls.get_or_create(user=user, token_type=token_type, **kwargs)

@classmethod
def get_valid(cls, token: str, async_mode: bool = False, **kwargs: Unpack[TokenFilterArgs]) -> "Token | None":
utc_now = timezone.now()
Expand Down
Loading

0 comments on commit 839b75f

Please sign in to comment.