-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add endpoints to be used by works api
- Loading branch information
Showing
89 changed files
with
2,810 additions
and
1,408 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
6 changes: 4 additions & 2 deletions
6
breathecode/activity/management/commands/upload_activities.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Generated by Django 5.1.4 on 2024-12-28 22:39 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("authenticate", "0061_googlewebhook_type"), | ||
] | ||
|
||
operations = [ | ||
migrations.DeleteModel( | ||
name="App", | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
58 changes: 58 additions & 0 deletions
58
breathecode/authenticate/tests/serializers/tests_capy_app_academy_serializer.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import capyc.django.serializer as capy | ||
|
||
from breathecode.authenticate.models import Academy | ||
from breathecode.authenticate.serializers import CapyAppAcademySerializer | ||
|
||
|
||
def test_is_capy_serializer(): | ||
serializer = CapyAppAcademySerializer() | ||
assert isinstance(serializer, capy.Serializer) | ||
|
||
|
||
def test_fields(): | ||
assert CapyAppAcademySerializer.fields == { | ||
"default": ("id", "name", "slug", "legal_name", "status"), | ||
"meta": ("white_labeled", "available_as_saas", "is_hidden_on_prework", "timezone"), | ||
"marketing": ("active_campaign_slug", "logistical_information"), | ||
"urls": ("logo_url", "icon_url", "website_url", "white_label_url"), | ||
"emails": ("marketing_email", "feedback_email"), | ||
"social": ("linkedin_url", "youtube_url"), | ||
"location": ("city[]", "country[]", "latitude", "longitude", "zip_code", "street_address"), | ||
"timestamps": ("created_at", "updated_at"), | ||
} | ||
|
||
|
||
def test_filters(): | ||
assert CapyAppAcademySerializer.filters == ( | ||
"name", | ||
"slug", | ||
"legal_name", | ||
"status", | ||
"created_at", | ||
"available_as_saas", | ||
) | ||
|
||
|
||
def test_path(): | ||
assert CapyAppAcademySerializer.path == "/v1/auth/app/academy" | ||
|
||
|
||
def test_model(): | ||
assert CapyAppAcademySerializer.model == Academy | ||
|
||
|
||
def test_references(): | ||
serializer = CapyAppAcademySerializer() | ||
|
||
result = {} | ||
for field in dir(serializer): | ||
if field.startswith("_"): | ||
continue | ||
|
||
if isinstance(x := getattr(serializer, field), capy.Serializer): | ||
result[field] = x.__module__ + "." + x.__class__.__name__ | ||
|
||
assert result == { | ||
"city": "breathecode.authenticate.serializers.CapyAppCitySerializer", | ||
"country": "breathecode.authenticate.serializers.CapyAppCountrySerializer", | ||
} |
42 changes: 42 additions & 0 deletions
42
breathecode/authenticate/tests/serializers/tests_capy_app_city_serializer.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import capyc.django.serializer as capy | ||
|
||
from breathecode.admissions.models import City | ||
from breathecode.authenticate.serializers import CapyAppCitySerializer, CapyAppCountrySerializer | ||
|
||
|
||
def test_is_capy_serializer(): | ||
serializer = CapyAppCitySerializer() | ||
assert isinstance(serializer, capy.Serializer) | ||
|
||
|
||
def test_fields(): | ||
assert CapyAppCitySerializer.fields == { | ||
"default": ("id", "name", "country"), | ||
"country": ("country[]",), | ||
} | ||
|
||
|
||
def test_filters(): | ||
assert CapyAppCitySerializer.filters == ("name",) | ||
|
||
|
||
def test_path(): | ||
assert CapyAppCitySerializer.path == "/v1/auth/app/city" | ||
|
||
|
||
def test_model(): | ||
assert CapyAppCitySerializer.model == City | ||
|
||
|
||
def test_references(): | ||
serializer = CapyAppCitySerializer() | ||
|
||
result = {} | ||
for field in dir(serializer): | ||
if field.startswith("_"): | ||
continue | ||
|
||
if isinstance(x := getattr(serializer, field), capy.Serializer): | ||
result[field] = x.__module__ + "." + x.__class__.__name__ | ||
|
||
assert result == {"country": "breathecode.authenticate.serializers.CapyAppCountrySerializer"} |
44 changes: 44 additions & 0 deletions
44
breathecode/authenticate/tests/serializers/tests_capy_app_country_serializer.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import capyc.django.serializer as capy | ||
|
||
from breathecode.admissions.models import Country | ||
from breathecode.authenticate.serializers import CapyAppCountrySerializer | ||
|
||
|
||
def test_is_capy_serializer(): | ||
serializer = CapyAppCountrySerializer() | ||
assert isinstance(serializer, capy.Serializer) | ||
|
||
|
||
def test_fields(): | ||
assert CapyAppCountrySerializer.fields == { | ||
"default": ("code", "name"), | ||
} | ||
|
||
|
||
def test_filters(): | ||
assert CapyAppCountrySerializer.filters == ( | ||
"code", | ||
"name", | ||
) | ||
|
||
|
||
def test_path(): | ||
assert CapyAppCountrySerializer.path == "/v1/auth/app/country" | ||
|
||
|
||
def test_model(): | ||
assert CapyAppCountrySerializer.model == Country | ||
|
||
|
||
def test_references(): | ||
serializer = CapyAppCountrySerializer() | ||
|
||
result = {} | ||
for field in dir(serializer): | ||
if field.startswith("_"): | ||
continue | ||
|
||
if isinstance(x := getattr(serializer, field), capy.Serializer): | ||
result[field] = x.__module__ + "." + x.__class__.__name__ | ||
|
||
assert result == {} |
Oops, something went wrong.