Esempio n. 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
Esempio n. 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
Esempio n. 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)
Esempio n. 4
0
 def __repr__(self):
     return format_repr(self, 'id', _text=self.full_name)
Esempio n. 5
0
 def __repr__(self):
     return format_repr(self, 'id', 'name', is_default=False)
Esempio n. 6
0
 def __repr__(self):
     return format_repr(self, 'id', 'url_template', _text=self.name)
Esempio n. 7
0
 def __repr__(self):
     return format_repr(self, 'id', 'name', is_deleted=False)
Esempio n. 8
0
 def __repr__(self):
     return format_repr(self, "id", _text=self.title)
Esempio n. 9
0
 def __repr__(self):
     return format_repr(self, 'id', 'subcontribution_id', 'reference_type_id', _text=self.value)
Esempio n. 10
0
 def __repr__(self):
     return format_repr(self, 'id', 'room_id', 'start_dt', 'end_dt', 'state', _text=self.booking_reason)
Esempio n. 11
0
 def __repr__(self):
     return format_repr(self, 'id', 'event_id', 'state')
Esempio n. 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))
Esempio n. 13
0
 def __repr__(self):
     return format_repr(self, 'event_id', 'legacy_registrant_id',
                        'legacy_registrant_key', 'registration_id')
Esempio n. 14
0
 def __repr__(self):
     return format_repr(self, 'legacy_page_id', 'page_id')
Esempio n. 15
0
 def __repr__(self):
     return format_repr(self, 'name', 'title', active=False)
Esempio n. 16
0
 def __repr__(self):
     return format_repr(self, 'name', 'title', 'url')
Esempio n. 17
0
 def __repr__(self):
     return format_repr(self, 'id', _text=self.title)
Esempio n. 18
0
 def __repr__(self):
     return format_repr(self, 'id', 'revision_id', is_deleted=False, _text=text_to_repr(self.text))
Esempio n. 19
0
 def __repr__(self):
     return format_repr(self, 'id', 'event_id', 'category_id', _text=self.title)
Esempio n. 20
0
 def __repr__(self):
     return format_repr(self, 'id', _rawtext=self.link_repr)
Esempio n. 21
0
 def __repr__(self):
     return format_repr(self, "event_id", "legacy_registrant_id", "legacy_registrant_key", "registration_id")
Esempio n. 22
0
 def __repr__(self):
     return format_repr(self, 'id', _text=text_to_repr(self.html, html=True))
Esempio n. 23
0
 def __repr__(self):
     return format_repr(self, 'contribution_id', 'contribution_field_id', _text=self.data)
Esempio n. 24
0
 def __repr__(self):
     return format_repr(self, 'id', 'email')
Esempio n. 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)
Esempio n. 26
0
 def __repr__(self):
     return format_repr(self,
                        'id',
                        'person_id',
                        'subcontribution_id',
                        _text=self.full_name)
Esempio n. 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)
Esempio n. 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))
Esempio n. 29
0
 def __repr__(self):
     return format_repr(self, 'id', _text=text_to_repr(self.html, html=True))
Esempio n. 30
0
 def __repr__(self):
     return format_repr(self, 'id', 'event_id', 'scheduled_dt', is_sent=False)
Esempio n. 31
0
 def __repr__(self):
     return format_repr(self,
                        'id',
                        is_deleted=False,
                        _text=text_to_repr(self.title, max_length=75))
Esempio n. 32
0
 def __repr__(self):
     return format_repr(self,
                        'id',
                        'event_id',
                        is_deleted=False,
                        _text=text_to_repr(self.title))
Esempio n. 33
0
 def __repr__(self):
     return format_repr(self, 'id', is_deleted=False, _text=self.title)
Esempio n. 34
0
 def __repr__(self):
     return format_repr(self, 'id', _text=text_to_repr(self.title))
Esempio n. 35
0
 def __repr__(self):
     return format_repr(self, 'id', 'uuid')
Esempio n. 36
0
 def __repr__(self):
     return format_repr(self, 'group_id', 'network')
Esempio n. 37
0
 def __repr__(self):
     return format_repr(self, 'event_id', 'legacy_session_id', 'session_id')
Esempio n. 38
0
 def __repr__(self):
     return format_repr(self,
                        'id',
                        'name',
                        hidden=False,
                        attachment_access_override=False)
Esempio n. 39
0
 def __repr__(self):
     return format_repr(self, 'legacy_page_id', 'image_id')
Esempio n. 40
0
 def __repr__(self):
     return format_repr(self,
                        'id',
                        'abstract_id',
                        'user_id',
                        proposed_action=None)
Esempio n. 41
0
 def __repr__(self):
     return format_repr(self, 'id', 'type', 'revision_id', 'user_id', proposed_action=None)
Esempio n. 42
0
 def __repr__(self):
     return format_repr(self,
                        'id',
                        'subcontribution_id',
                        'reference_type_id',
                        _text=self.value)
Esempio n. 43
0
 def __repr__(self):
     return format_repr(self, 'id', 'revision_id', is_deleted=False, _text=text_to_repr(self.text))
Esempio n. 44
0
 def __repr__(self):
     return format_repr(self, 'id', 'name', _text=self.title)
Esempio n. 45
0
 def __repr__(self):
     return format_repr(self, 'id', 'field_type', is_required=False, is_active=True, _text=self.title)
Esempio n. 46
0
 def __repr__(self):
     return format_repr(self,
                        'id',
                        'event_id',
                        'filename',
                        content_type=None)
Esempio n. 47
0
 def __repr__(self):
     return format_repr(self, 'id', 'event_id', 'reference_type_id', _text=self.value)
Esempio n. 48
0
 def __repr__(self):
     return format_repr(self, 'id', 'email', is_deleted=False, is_pending=False, _text=self.full_name)
Esempio n. 49
0
 def __repr__(self):
     return format_repr(self, 'id', 'event_id', 'principal', read_access=False, full_access=False, roles=[])
Esempio n. 50
0
 def __repr__(self):
     return format_repr(self, 'id', is_deleted=False, _text=self.title)
Esempio n. 51
0
 def __repr__(self):
     return format_repr(self, 'id', 'person_id', 'session_block_id', _text=self.full_name)
Esempio n. 52
0
 def __repr__(self):
     return format_repr(self, 'id')
Esempio n. 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)
Esempio n. 54
0
 def __repr__(self):
     return format_repr(self, 'id', 'affiliation_id', _text=self.name)
Esempio n. 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)
Esempio n. 56
0
 def __repr__(self):
     return format_repr(self, 'id', _text=self.name)
Esempio n. 57
0
 def __repr__(self):
     return format_repr(self, 'id', 'person_id', 'event_id', _text=self.full_name)
Esempio n. 58
0
 def __repr__(self):
     return format_repr(self, 'id', 'contribution_id', 'type')
Esempio n. 59
0
 def __repr__(self):
     return format_repr(self, 'id', '_contribution_id', content_type=None, _text=text_to_repr(self.filename))
Esempio n. 60
0
 def __repr__(self):
     return format_repr(self,
                        'id',
                        'person_id',
                        'event_id',
                        _text=self.full_name)