1313from pytz import UTC
1414from rest_framework .exceptions import ValidationError
1515from rest_framework .reverse import reverse
16+ from shared .django_apps .core .tests .factories import OwnerFactory , RepositoryFactory
1617
1718from api .internal .chart .filters import apply_default_filters , apply_simple_filters
1819from api .internal .chart .helpers import (
2324)
2425from codecov .tests .base_test import InternalAPITest
2526from core .models import Commit
26- from core .tests .factories import OwnerFactory , RepositoryFactory
2727from utils .test_utils import Client
2828
2929fake = faker .Faker ()
@@ -56,7 +56,7 @@ def generate_random_totals(
5656def setup_commits (
5757 repo ,
5858 num_commits ,
59- branch = "master " ,
59+ branch = "main " ,
6060 start_date = None ,
6161 meets_default_filters = True ,
6262 ** kwargs ,
@@ -251,7 +251,7 @@ def test_apply_simple_filters(self):
251251 end_date = datetime .now ()
252252 data = {
253253 "owner_username" : self .org1 .username ,
254- "branch" : "master " ,
254+ "branch" : "main " ,
255255 "start_date" : start_date .isoformat (),
256256 "end_date" : end_date .isoformat (),
257257 "repositories" : [self .repo1_org1 .name , self .repo2_org1 .name ],
@@ -318,7 +318,7 @@ def test_apply_simple_filters_branch_filtering(self):
318318 for commit in queryset :
319319 assert (
320320 commit .repository .name == self .repo1_org1 .name
321- and commit .branch == "master "
321+ and commit .branch == "main "
322322 ) or (
323323 commit .repository .name == branch_test .name and commit .branch == "main"
324324 )
@@ -860,7 +860,7 @@ def setUp(self):
860860
861861 def test_no_permissions (self , mocked_get_permissions ):
862862 data = {
863- "branch" : "master " ,
863+ "branch" : "main " ,
864864 "start_date" : timezone .now () - timedelta (7 ),
865865 "end_date" : timezone .now (),
866866 "grouping_unit" : "commit" ,
@@ -879,7 +879,7 @@ def test_no_permissions(self, mocked_get_permissions):
879879 @pytest .mark .skip (reason = "flaky, skipping until re write" )
880880 def test_get_commits_no_time_grouping (self , mocked_get_permissions ):
881881 data = {
882- "branch" : "master " ,
882+ "branch" : "main " ,
883883 "start_date" : timezone .now () - timedelta (7 ),
884884 "end_date" : timezone .now (),
885885 "grouping_unit" : "commit" ,
@@ -897,7 +897,7 @@ def test_get_commits_no_time_grouping(self, mocked_get_permissions):
897897
898898 def test_get_commits_with_time_grouping (self , mocked_get_permissions ):
899899 data = {
900- "branch" : "master " ,
900+ "branch" : "main " ,
901901 "start_date" : timezone .now () - timedelta (7 ),
902902 "end_date" : timezone .now (),
903903 "grouping_unit" : "day" ,
@@ -917,7 +917,7 @@ def test_get_commits_with_time_grouping(self, mocked_get_permissions):
917917
918918 def test_get_commits_with_coverage_change (self , mocked_get_permissions ):
919919 data = {
920- "branch" : "master " ,
920+ "branch" : "main " ,
921921 "start_date" : timezone .now () - timedelta (7 ),
922922 "end_date" : timezone .now (),
923923 "grouping_unit" : "day" ,
0 commit comments