Skip to content

Commit

Permalink
Merge pull request #861 from thunderstore-io/fix-team-creation
Browse files Browse the repository at this point in the history
Fix the team creation view
  • Loading branch information
MythicManiac authored Jul 20, 2023
2 parents e944b8a + 48a246f commit b38e958
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion django/thunderstore/frontend/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class ManifestV1ValidatorView(TemplateView):
template_name = "frontend/manifest_v1_validator.html"


class SettingsViewMixin(TemplateView):
class SettingsViewMixin:
def get_context_data(self, **kwargs: Any) -> Dict[str, Any]:
context = super().get_context_data(**kwargs)
context["setting_links"] = plugin_registry.get_settings_links()
Expand Down
19 changes: 19 additions & 0 deletions django/thunderstore/repository/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,25 @@ def test_service_account_creation(client, community_site, team, team_owner):
assert b'<pre class="important">tss_' in response.content


@pytest.mark.django_db
def test_team_creation_view(client, community_site, team_owner):
client.force_login(team_owner.user)

response = client.get(
reverse("settings.teams.create"),
HTTP_HOST=community_site.site.domain,
)
assert response.status_code == 200
assert b"Enter the name of the team you wish to create." in response.content

response = client.post(
reverse("settings.teams.create"),
{"name": "TeamName"},
HTTP_HOST=community_site.site.domain,
)
assert response.status_code == 302


@pytest.mark.django_db
def test_team_settings_donation_link_view(
client: APIClient,
Expand Down

0 comments on commit b38e958

Please sign in to comment.