Updated tests to match the submission API info page.
- Legacy-Id: 14127
This commit is contained in:
parent
8d3c540edd
commit
6aa2cfca89
|
@ -1560,9 +1560,7 @@ class ApiSubmitTests(TestCase):
|
||||||
settings.INTERNET_DRAFT_ARCHIVE_DIR = self.saved_archive_dir
|
settings.INTERNET_DRAFT_ARCHIVE_DIR = self.saved_archive_dir
|
||||||
|
|
||||||
def post_submission(self, rev, author=None, name=None, group=None, email=None, title=None, year=None):
|
def post_submission(self, rev, author=None, name=None, group=None, email=None, title=None, year=None):
|
||||||
|
|
||||||
url = urlreverse('ietf.submit.views.api_submit')
|
url = urlreverse('ietf.submit.views.api_submit')
|
||||||
|
|
||||||
if author is None:
|
if author is None:
|
||||||
author = PersonFactory()
|
author = PersonFactory()
|
||||||
if name is None:
|
if name is None:
|
||||||
|
@ -1570,19 +1568,22 @@ class ApiSubmitTests(TestCase):
|
||||||
name = 'draft-%s-foo' % slug
|
name = 'draft-%s-foo' % slug
|
||||||
if email is None:
|
if email is None:
|
||||||
email = author.user.username
|
email = author.user.username
|
||||||
|
|
||||||
# submit
|
# submit
|
||||||
data = {}
|
data = {}
|
||||||
data['xml'], author = submission_file(name, rev, group, 'xml', "test_submission.xml", author=author, email=email, title=title, year=year)
|
data['xml'], author = submission_file(name, rev, group, 'xml', "test_submission.xml", author=author, email=email, title=title, year=year)
|
||||||
data['user'] = email
|
data['user'] = email
|
||||||
|
|
||||||
r = self.client.post(url, data)
|
r = self.client.post(url, data)
|
||||||
|
|
||||||
return r, author, name
|
return r, author, name
|
||||||
|
|
||||||
|
def test_api_submit_info(self):
|
||||||
|
url = urlreverse('ietf.submit.views.api_submit')
|
||||||
|
r = self.client.get(url)
|
||||||
|
expected = "A simplified draft submission interface, intended for automation"
|
||||||
|
self.assertContains(r, expected, status_code=200)
|
||||||
|
|
||||||
def test_api_submit_bad_method(self):
|
def test_api_submit_bad_method(self):
|
||||||
url = urlreverse('ietf.submit.views.api_submit')
|
url = urlreverse('ietf.submit.views.api_submit')
|
||||||
r = self.client.get(url)
|
r = self.client.put(url)
|
||||||
self.assertEqual(r.status_code, 405)
|
self.assertEqual(r.status_code, 405)
|
||||||
|
|
||||||
def test_api_submit_ok(self):
|
def test_api_submit_ok(self):
|
||||||
|
|
Loading…
Reference in a new issue