Skip to content

Commit d221ed2

Browse files
committed
Minor changes in tests
1 parent 7f53a0f commit d221ed2

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

main/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ def all_components(request): # requested on_load() for querying
2626
})
2727

2828
def top_components(request):
29-
top_components = TopComponentSerializer(Component.objects.all().order_by('-downloads')[:10], many=True)
29+
# Download data is from Github and hence stars are used
30+
top_components = TopComponentSerializer(Component.objects.all().order_by('-stars')[:10], many=True)
3031
return JsonResponse({
3132
'top_components':top_components.data,
3233
})

tests/test_views.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ def test_relevance_of_response(self):
277277
'license' in object
278278
)
279279
# check if number of commits >= 50, from the time the tests were initiated
280+
### As number of stars, watchers might go down in the future so they haven't been tested
280281
self.assertTrue(int(response.json()['details']['commits']) >= 50)
281282

282283
# modified date should be after created date

0 commit comments

Comments
 (0)