-
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
Can Özyurt
committed
Jul 4, 2022
1 parent
b7864aa
commit 2c6b750
Showing
2 changed files
with
38 additions
and
7 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
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,19 @@ | ||
import django | ||
import os | ||
import unittest | ||
from requests import Request | ||
|
||
os.environ.setdefault("DJANGO_SETTINGS_MODULE","maasserver.djangosettings.development") | ||
django.setup() | ||
|
||
from maasserver.api.domains import DomainsHandler | ||
from maasserver.testing.testcase import MAASServerTestCase | ||
|
||
|
||
class DomainsHandlerTests(MAASServerTestCase): | ||
def test_domain_create(self): | ||
data = {"name": "adfasf"} | ||
request = Request('POST', 'localhost', data=data) | ||
request.user = type("User", (), {"is_superuser": True}) | ||
handler = DomainsHandler() | ||
handler.create(request=request) |