Skip to content

Commit bfd57d3

Browse files
authored
Merge pull request #5842 from stsewd/add-test-for-remote-repo-form
Add test for remote repo form
2 parents 0f9a646 + ab1e8b7 commit bfd57d3

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

readthedocs/rtd_tests/tests/test_project_views.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,27 @@ def request(self, *args, **kwargs):
105105
kwargs['user'] = self.user
106106
return super().request(*args, **kwargs)
107107

108+
def test_form_import_from_remote_repo(self):
109+
self.client.force_login(self.user)
110+
111+
data = {
112+
'name': 'pipdocs',
113+
'repo': 'https://github.com/fail/sauce',
114+
'repo_type': 'git',
115+
'remote_repository': '1234',
116+
}
117+
resp = self.client.post(
118+
'/dashboard/import/',
119+
data,
120+
)
121+
self.assertEqual(resp.status_code, 200)
122+
123+
# The form is filled with the previous information
124+
self.assertEqual(
125+
resp.context['form'].initial,
126+
data,
127+
)
128+
108129
def test_form_pass(self):
109130
"""Only submit the basics."""
110131
resp = self.post_step('basics')

0 commit comments

Comments
 (0)