-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
218 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[run] | ||
omit = minchoc/wsgi.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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# pragma no cover | ||
from django.core.wsgi import get_wsgi_application | ||
|
||
__all__ = ('application',) | ||
|
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,33 @@ | ||
import pytest | ||
|
||
from minchoc.models import Company, NugetUser, Package, Tag | ||
|
||
|
||
@pytest.mark.django_db | ||
def test_company_str(): | ||
company = Company.objects.create(name='Company name') | ||
assert str(company) == 'Company name' | ||
|
||
|
||
@pytest.mark.django_db | ||
def test_tag_str(): | ||
tag = Tag.objects.create(name='Tag name') | ||
assert str(tag) == 'Tag name' | ||
|
||
|
||
@pytest.mark.django_db | ||
def test_package_str(nuget_user: NugetUser) -> None: | ||
package = Package.objects.create(nuget_id='somename', | ||
title='somename', | ||
uploader=nuget_user, | ||
version='123.0', | ||
version0=123, | ||
version1=1, | ||
size=1) | ||
assert str(package) == 'somename 123.0' | ||
|
||
|
||
@pytest.mark.django_db | ||
def test_nuget_user_str(nuget_user: NugetUser) -> None: | ||
nuget_user.base.username = 'fakename' | ||
assert str(nuget_user) == 'fakename' |
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,23 @@ | ||
from django.test import Client | ||
import pytest | ||
|
||
|
||
def test_home(client: Client) -> None: | ||
response = client.get('/') | ||
assert response.content == b'{}' | ||
assert response.get('content-type') == 'application/json' | ||
assert response.status_code == 200 | ||
|
||
|
||
@pytest.mark.django_db | ||
def test_metadata(client: Client) -> None: | ||
response = client.get('/$metadata') | ||
assert response.get('content-type') == 'application/xml' | ||
assert response.status_code == 200 | ||
|
||
|
||
@pytest.mark.django_db | ||
def test_metadata_alt(client: Client) -> None: | ||
response = client.get('/api/v2/$metadata') | ||
assert response.get('content-type') == 'application/xml' | ||
assert response.status_code == 200 |
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