File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,14 @@ <h1 class="text-3xl font-semibold leading-tight tracking-normal md:text-4xl">
2323 < i class ="fas fa-user-plus "> </ i > Register
2424 </ a >
2525 {% endif %}
26+ {% if course.github_repo_url %}
27+ < a href ="{{ course.github_repo_url }} "
28+ target ="_blank "
29+ rel ="noopener noreferrer "
30+ class ="primer-button primer-button-secondary whitespace-nowrap ">
31+ < i class ="fab fa-github " aria-hidden ="true "> </ i > GitHub
32+ </ a >
33+ {% endif %}
2634 {% if course.first_homework_scored %}
2735 < a href ="{% url 'leaderboard' course.slug %} " class ="primer-button primer-button-secondary whitespace-nowrap ">
2836 < i class ="fas fa-trophy "> </ i > Course leaderboard
Original file line number Diff line number Diff line change @@ -190,6 +190,26 @@ def test_course_detail_shows_registration_url(self):
190190 "https://courses.datatalks.club/test-course/register" ,
191191 )
192192
193+ def test_course_detail_shows_github_repo_url (self ):
194+ self .course .github_repo_url = (
195+ "https://github.com/DataTalksClub/test-course"
196+ )
197+ self .course .save ()
198+
199+ url = reverse (
200+ "course" , kwargs = {"course_slug" : self .course .slug }
201+ )
202+
203+ response = self .client .get (url )
204+
205+ self .assertEqual (response .status_code , 200 )
206+ self .assertContains (response , "fab fa-github" )
207+ self .assertContains (response , "GitHub" )
208+ self .assertContains (
209+ response ,
210+ "https://github.com/DataTalksClub/test-course" ,
211+ )
212+
193213 def test_course_detail_shows_calendar_feed_link (self ):
194214 url = reverse (
195215 "course" , kwargs = {"course_slug" : self .course .slug }
You can’t perform that action at this time.
0 commit comments