Ejemplo n.º 1
0
def test_submitter_serializer_without_profile(submission):
    user = submission.speakers.first()
    user.profiles.all().delete()
    data = SubmitterSerializer(user, context={'event': submission.event}).data
    assert data.keys() == {'name', 'code', 'biography', 'avatar'}
    assert data['name'] == user.name
    assert data['code'] == user.code
    assert data['biography'] == ''
Ejemplo n.º 2
0
def test_submitter_serializer_without_profile(submission):
    with scope(event=submission.event):
        user = submission.speakers.first()
        user.profiles.all().delete()
        data = SubmitterSerializer(user, context={
            "event": submission.event
        }).data
    assert data.keys() == {"name", "code", "biography", "avatar"}
    assert data["name"] == user.name
    assert data["code"] == user.code
    assert data["biography"] == ""
Ejemplo n.º 3
0
def test_submitter_serializer(submission):
    user = submission.speakers.first()
    data = SubmitterSerializer(user, context={'event': submission.event}).data
    assert data.keys() == {'name', 'code', 'biography', 'avatar'}
    assert data['name'] == user.name
    assert data['code'] == user.code
Ejemplo n.º 4
0
def test_submitter_serializer(submission):
    user = submission.speakers.first()
    data = SubmitterSerializer(user, context={"event": submission.event}).data
    assert data.keys() == {"name", "code", "biography", "avatar"}
    assert data["name"] == user.name
    assert data["code"] == user.code