@pytest.mark.django_db
def test_submission_proxy_timeline_info(quality_check_submission):
 subs = Submission.objects.filter(pk=quality_check_submission.pk)
 sub = subs.values(*SubmissionProxy.timeline_fields).first()
 proxy = SubmissionProxy(sub)
 assert (proxy.unit_info == {})
 assert (proxy.unit_translate_url is None)
 assert (proxy.unit_pootle_path is None)
 assert (proxy.unit_state is None)
 non_unit_fields = ['username', 'display_datetime', 'displayname', 'mtime', 'type', 'email', 'profile_url']
 proxy_info = proxy.get_submission_info()
 sub_info = quality_check_submission.get_submission_info()
 for k in non_unit_fields:
  assert (proxy_info[k] == sub_info[k])

@ pytest . mark . django_db def test_submission_proxy_timeline_info ( quality_check_submission ) : subs = Submission . objects . filter ( pk = quality_check_submission . pk ) sub = subs . values ( * SubmissionProxy . timeline_fields ) . first ( ) proxy = SubmissionProxy ( sub ) assert ( proxy . unit_info == { } ) assert ( proxy . unit_translate_url is None ) assert ( proxy . unit_pootle_path is None ) assert ( proxy . unit_state is None ) non_unit_fields = [ 'username' , 'display_datetime' , 'displayname' , 'mtime' , 'type' , 'email' , 'profile_url' ] proxy_info = proxy . get_submission_info ( ) sub_info = quality_check_submission . get_submission_info ( ) for k in non_unit_fields : assert ( proxy_info [ k ] == sub_info [ k ] )
if you use the timeline fields but call get_submission_info you will get the sub info without the unit data .