def __init__(self, server_config=None, **kwargs): self._fields = { 'audit_comment': entity_fields.StringField(), 'description_format': entity_fields.StringField(), 'effective_user': entity_fields.DictField(), 'job_category': entity_fields.StringField(), 'location': entity_fields.OneToManyField(Location), 'locked': entity_fields.BooleanField(), 'name': entity_fields.StringField(), 'organization': entity_fields.OneToManyField(Organization), 'provider_type': entity_fields.StringField(), 'snippet': entity_fields.BooleanField(), 'template': entity_fields.StringField(), 'template_inputs': entity_fields.OneToManyField(TemplateInput), } self._meta = { 'api_path': 'api/v2/job_templates', 'server_modes': ('sat')} super(JobTemplate, self).__init__(server_config, **kwargs)
def test_one_to_many_field(self): """Test :meth:`nailgun.entity_fields.OneToManyField.gen_value`.""" self.assertEqual( entity_fields.OneToManyField(TestClass).gen_value(), TestClass)