本文整理匯總了Python中reviewboard.scmtools.forms.RepositoryForm._get_field_data方法的典型用法代碼示例。如果您正苦於以下問題:Python RepositoryForm._get_field_data方法的具體用法?Python RepositoryForm._get_field_data怎麽用?Python RepositoryForm._get_field_data使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類reviewboard.scmtools.forms.RepositoryForm
的用法示例。
在下文中一共展示了RepositoryForm._get_field_data方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_with_hosting_service_with_existing_custom_bug_tracker
# 需要導入模塊: from reviewboard.scmtools.forms import RepositoryForm [as 別名]
# 或者: from reviewboard.scmtools.forms.RepositoryForm import _get_field_data [as 別名]
def test_with_hosting_service_with_existing_custom_bug_tracker(self):
"""Testing RepositoryForm with existing custom bug tracker"""
repository = Repository(name='test',
bug_tracker='http://example.com/issue/%s')
form = RepositoryForm(instance=repository)
self.assertFalse(form._get_field_data('bug_tracker_use_hosting'))
self.assertEqual(form._get_field_data('bug_tracker_type'), 'custom')
self.assertEqual(form.initial['bug_tracker'],
'http://example.com/issue/%s')
示例2: test_with_hosting_service_with_existing_bug_tracker_service
# 需要導入模塊: from reviewboard.scmtools.forms import RepositoryForm [as 別名]
# 或者: from reviewboard.scmtools.forms.RepositoryForm import _get_field_data [as 別名]
def test_with_hosting_service_with_existing_bug_tracker_service(self):
"""Testing RepositoryForm with existing bug tracker service"""
repository = Repository(name='test')
repository.extra_data['bug_tracker_type'] = 'test'
repository.extra_data['bug_tracker-test_repo_name'] = 'testrepo'
repository.extra_data['bug_tracker-hosting_account_username'] = \
'testuser'
form = RepositoryForm(instance=repository)
self.assertFalse(form._get_field_data('bug_tracker_use_hosting'))
self.assertEqual(form._get_field_data('bug_tracker_type'), 'test')
self.assertEqual(
form._get_field_data('bug_tracker_hosting_account_username'),
'testuser')
self.assertIn('test', form.bug_tracker_forms)
self.assertIn('default', form.bug_tracker_forms['test'])
bitbucket_form = form.bug_tracker_forms['test']['default']
self.assertEqual(
bitbucket_form.fields['test_repo_name'].initial,
'testrepo')
示例3: test_with_hosting_service_with_existing_bug_tracker_using_hosting
# 需要導入模塊: from reviewboard.scmtools.forms import RepositoryForm [as 別名]
# 或者: from reviewboard.scmtools.forms.RepositoryForm import _get_field_data [as 別名]
def test_with_hosting_service_with_existing_bug_tracker_using_hosting(
self):
"""Testing RepositoryForm with existing bug tracker using hosting
service
"""
account = HostingServiceAccount.objects.create(username='testuser',
service_name='test')
repository = Repository(name='test',
hosting_account=account)
repository.extra_data['bug_tracker_use_hosting'] = True
repository.extra_data['test_repo_name'] = 'testrepo'
form = RepositoryForm(instance=repository)
self.assertTrue(form._get_field_data('bug_tracker_use_hosting'))