Example #1
0
def test_format_repr(args, kwargs, output):
    class Foo(object):
        def __init__(self, **kwargs):
            self.__dict__.update(kwargs)

    obj = Foo(id=1, hello='world', dct={'a': 'b'}, flag1=True, flag0=False)
    assert format_repr(obj, *args, **kwargs) == output
Example #2
0
def test_format_repr(args, kwargs, output):
    class Foo(object):
        def __init__(self, **kwargs):
            self.__dict__.update(kwargs)

    class MyEnum(Enum):
        foo = "bar"

    obj = Foo(id=1, enum=MyEnum.foo, hello="world", dct={"a": "b"}, flag1=True, flag0=False)
    assert format_repr(obj, *args, **kwargs) == output
Example #3
0
 def __repr__(self):
     return format_repr(self, 'id', 'registration_form_id', 'email', 'state',
                        user_id=None, is_deleted=False, _text=self.full_name)
Example #4
0
 def __repr__(self):
     return format_repr(self, 'id', _text=self.full_name)
Example #5
0
 def __repr__(self):
     return format_repr(self, 'id', 'name', is_default=False)
Example #6
0
 def __repr__(self):
     return format_repr(self, 'id', 'url_template', _text=self.name)
Example #7
0
 def __repr__(self):
     return format_repr(self, 'id', 'name', is_deleted=False)
Example #8
0
 def __repr__(self):
     return format_repr(self, "id", _text=self.title)
Example #9
0
 def __repr__(self):
     return format_repr(self, 'id', 'subcontribution_id', 'reference_type_id', _text=self.value)
Example #10
0
 def __repr__(self):
     return format_repr(self, 'id', 'room_id', 'start_dt', 'end_dt', 'state', _text=self.booking_reason)
Example #11
0
 def __repr__(self):
     return format_repr(self, 'id', 'event_id', 'state')
Example #12
0
 def __repr__(self):
     return format_repr(self, 'id', 'start_dt', 'end_dt', is_deleted=False, is_locked=False,
                        _text=text_to_repr(self.title, max_length=75))
Example #13
0
 def __repr__(self):
     return format_repr(self, 'event_id', 'legacy_registrant_id',
                        'legacy_registrant_key', 'registration_id')
Example #14
0
 def __repr__(self):
     return format_repr(self, 'legacy_page_id', 'page_id')
Example #15
0
 def __repr__(self):
     return format_repr(self, 'name', 'title', active=False)
Example #16
0
 def __repr__(self):
     return format_repr(self, 'name', 'title', 'url')
Example #17
0
 def __repr__(self):
     return format_repr(self, 'id', _text=self.title)
Example #18
0
 def __repr__(self):
     return format_repr(self, 'id', 'revision_id', is_deleted=False, _text=text_to_repr(self.text))
Example #19
0
 def __repr__(self):
     return format_repr(self, 'id', 'event_id', 'category_id', _text=self.title)
Example #20
0
 def __repr__(self):
     return format_repr(self, 'id', _rawtext=self.link_repr)
Example #21
0
 def __repr__(self):
     return format_repr(self, "event_id", "legacy_registrant_id", "legacy_registrant_key", "registration_id")
Example #22
0
 def __repr__(self):
     return format_repr(self, 'id', _text=text_to_repr(self.html, html=True))
Example #23
0
 def __repr__(self):
     return format_repr(self, 'contribution_id', 'contribution_field_id', _text=self.data)
Example #24
0
 def __repr__(self):
     return format_repr(self, 'id', 'email')
Example #25
0
 def __repr__(self):
     return format_repr(self, 'id', 'registration_form_id', is_enabled=True, is_deleted=False, is_manager_only=False,
                        _text=self.title)
Example #26
0
 def __repr__(self):
     return format_repr(self,
                        'id',
                        'person_id',
                        'subcontribution_id',
                        _text=self.full_name)
Example #27
0
 def __repr__(self):
     ref_repr = '{}.{}.{}.{}'.format(self.category_id if self.category_id else 'x',
                                     self.event_id if self.event_id else 'x',
                                     self.contrib_id if self.contrib_id else 'x',
                                     self.subcontrib_id if self.subcontrib_id else 'x')
     return format_repr(self, 'agent', 'id', 'type', 'change', _text=ref_repr)
Example #28
0
 def __repr__(self):
     # TODO: add self.protection_repr once we use it
     return format_repr(self, 'id', 'start_dt', 'end_dt', is_deleted=False,
                        _text=text_to_repr(self.title, max_length=75))
Example #29
0
 def __repr__(self):
     return format_repr(self, 'id', _text=text_to_repr(self.html, html=True))
Example #30
0
 def __repr__(self):
     return format_repr(self, 'id', 'event_id', 'scheduled_dt', is_sent=False)
Example #31
0
 def __repr__(self):
     return format_repr(self,
                        'id',
                        is_deleted=False,
                        _text=text_to_repr(self.title, max_length=75))
Example #32
0
 def __repr__(self):
     return format_repr(self,
                        'id',
                        'event_id',
                        is_deleted=False,
                        _text=text_to_repr(self.title))
Example #33
0
 def __repr__(self):
     return format_repr(self, 'id', is_deleted=False, _text=self.title)
Example #34
0
 def __repr__(self):
     return format_repr(self, 'id', _text=text_to_repr(self.title))
Example #35
0
 def __repr__(self):
     return format_repr(self, 'id', 'uuid')
Example #36
0
 def __repr__(self):
     return format_repr(self, 'group_id', 'network')
Example #37
0
 def __repr__(self):
     return format_repr(self, 'event_id', 'legacy_session_id', 'session_id')
Example #38
0
 def __repr__(self):
     return format_repr(self,
                        'id',
                        'name',
                        hidden=False,
                        attachment_access_override=False)
Example #39
0
 def __repr__(self):
     return format_repr(self, 'legacy_page_id', 'image_id')
Example #40
0
 def __repr__(self):
     return format_repr(self,
                        'id',
                        'abstract_id',
                        'user_id',
                        proposed_action=None)
Example #41
0
 def __repr__(self):
     return format_repr(self, 'id', 'type', 'revision_id', 'user_id', proposed_action=None)
Example #42
0
 def __repr__(self):
     return format_repr(self,
                        'id',
                        'subcontribution_id',
                        'reference_type_id',
                        _text=self.value)
Example #43
0
 def __repr__(self):
     return format_repr(self, 'id', 'revision_id', is_deleted=False, _text=text_to_repr(self.text))
Example #44
0
 def __repr__(self):
     return format_repr(self, 'id', 'name', _text=self.title)
Example #45
0
 def __repr__(self):
     return format_repr(self, 'id', 'field_type', is_required=False, is_active=True, _text=self.title)
Example #46
0
 def __repr__(self):
     return format_repr(self,
                        'id',
                        'event_id',
                        'filename',
                        content_type=None)
Example #47
0
 def __repr__(self):
     return format_repr(self, 'id', 'event_id', 'reference_type_id', _text=self.value)
Example #48
0
 def __repr__(self):
     return format_repr(self, 'id', 'email', is_deleted=False, is_pending=False, _text=self.full_name)
Example #49
0
 def __repr__(self):
     return format_repr(self, 'id', 'event_id', 'principal', read_access=False, full_access=False, roles=[])
Example #50
0
 def __repr__(self):
     return format_repr(self, 'id', is_deleted=False, _text=self.title)
Example #51
0
 def __repr__(self):
     return format_repr(self, 'id', 'person_id', 'session_block_id', _text=self.full_name)
Example #52
0
 def __repr__(self):
     return format_repr(self, 'id')
Example #53
0
 def __repr__(self):
     full_name = '{} {}'.format(self.first_name, self.last_name)
     return format_repr(self, 'id', 'registration_form_id', 'email', 'state', _text=full_name)
Example #54
0
 def __repr__(self):
     return format_repr(self, 'id', 'affiliation_id', _text=self.name)
Example #55
0
 def __repr__(self):
     return format_repr(self, 'id', 'registration_form_id', 'email', 'state',
                        user_id=None, is_deleted=False, _text=self.full_name)
Example #56
0
 def __repr__(self):
     return format_repr(self, 'id', _text=self.name)
Example #57
0
 def __repr__(self):
     return format_repr(self, 'id', 'person_id', 'event_id', _text=self.full_name)
Example #58
0
 def __repr__(self):
     return format_repr(self, 'id', 'contribution_id', 'type')
Example #59
0
 def __repr__(self):
     return format_repr(self, 'id', '_contribution_id', content_type=None, _text=text_to_repr(self.filename))
Example #60
0
 def __repr__(self):
     return format_repr(self,
                        'id',
                        'person_id',
                        'event_id',
                        _text=self.full_name)