test.py
Develop and debug locally to ensure the application is correct.
After the application is uploaded, it will be automatically deleted.
Write test cases
from unittest import TestCase
from apps.jira.core import Jira
class JiraTestCase(TestCase):
def setUp(self):
self.configs = {
"server": "https://xxx.atlassian.net",
"email": "xxx@gmail.com",
"api_token": "xxxxxxxxxxxxxxxxxx"
}
def test(self):
res = Jira(self.configs).do_action(name="test", params={})
print(res)
def test_get_projects(self):
res = Jira(self.configs).do_action(name="get_projects", params={})
print(res)
def test_get_project(self):
res = Jira(self.configs).do_action(name="get_project", params={ "id": "DESK" })
print(res)
Run test cases
./manage.py test apps.jira.test
Last updated