def test_project_assigned_points(client, data):
    project_stats = get_stats_for_project(data.project)
    assert (project_stats['assigned_points_per_role'] == {data.role1.pk: 48, data.role2.pk: 0})
    data.user_story1.milestone = data.user_story6.milestone
    data.user_story1.save()
    project_stats = get_stats_for_project(data.project)
    assert (project_stats['assigned_points_per_role'] == {data.role1.pk: 49, data.role2.pk: 0})
    data.user_story2.milestone = data.user_story6.milestone
    data.user_story2.save()
    project_stats = get_stats_for_project(data.project)
    assert (project_stats['assigned_points_per_role'] == {data.role1.pk: 51, data.role2.pk: 0})
    data.user_story3.milestone = data.user_story6.milestone
    data.user_story3.save()
    project_stats = get_stats_for_project(data.project)
    assert (project_stats['assigned_points_per_role'] == {data.role1.pk: 55, data.role2.pk: 0})
    data.user_story4.milestone = data.user_story6.milestone
    data.user_story4.save()
    project_stats = get_stats_for_project(data.project)
    assert (project_stats['assigned_points_per_role'] == {data.role1.pk: 63, data.role2.pk: 0})
def test_project_assigned_points(client, data):
    project_stats = get_stats_for_project(data.project)
    assert (project_stats['assigned_points_per_role'] == {data.role1.pk: 48, data.role2.pk: 0})
    data.user_story1.milestone = data.user_story6.milestone
    data.user_story1.save()
    project_stats = get_stats_for_project(data.project)
    assert (project_stats['assigned_points_per_role'] == {data.role1.pk: 49, data.role2.pk: 0})
    data.user_story2.milestone = data.user_story6.milestone
    data.user_story2.save()
    project_stats = get_stats_for_project(data.project)
    assert (project_stats['assigned_points_per_role'] == {data.role1.pk: 51, data.role2.pk: 0})
    data.user_story3.milestone = data.user_story6.milestone
    data.user_story3.save()
    project_stats = get_stats_for_project(data.project)
    assert (project_stats['assigned_points_per_role'] == {data.role1.pk: 55, data.role2.pk: 0})
    data.user_story4.milestone = data.user_story6.milestone
    data.user_story4.save()
    project_stats = get_stats_for_project(data.project)
    assert (project_stats['assigned_points_per_role'] == {data.role1.pk: 63, data.role2.pk: 0})