Skip to content

Commit

Permalink
Merge pull request #167 from bounswe/practice-app/bug-fix/testing-err…
Browse files Browse the repository at this point in the history
…ors-#166

After review, It looks like the bugs have been fixed. I am merging this pull request. Thanks to Halil and Bengin for their collaborations.
  • Loading branch information
enginoguzhansenol authored May 20, 2022
2 parents 58f5ff8 + 2514f7d commit 0171ef8
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 15 deletions.
1 change: 0 additions & 1 deletion practice-app/category/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ def getCategories(request):

@api_view(['GET', 'POST'])
def postCategory(request):
print(request.method)
if request.method == 'GET':
postForm = categoriesPostForm()
return render(request, "createForm_category.html", {"post_form":postForm})
Expand Down
3 changes: 0 additions & 3 deletions practice-app/rate_article/tests.py

This file was deleted.

Empty file.
2 changes: 1 addition & 1 deletion practice-app/rate_article/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

urlpatterns = [
path('', views.indexRateArticle, name='index1'),
path('api/<int:pk>',views.articleVotes.as_view()),
path('api/<int:pk>',views.articleVotes.as_view(), name='api'),
path('get/', views.articleVotes.getVoteApis, name="getVoteApis"),
path('post/', views.articleVotes.postVoteApis, name="postVoteApis"),
]
2 changes: 1 addition & 1 deletion practice-app/rate_comment/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

urlpatterns = [
path('', views.index, name="Commentindex"),
path('api/<int:pk>', views.CommentRating.as_view()),
path('api/<int:pk>', views.CommentRating.as_view(), name='api'),
path('get/', views.CommentRating.getCommentVoteApi, name='getCommentVoteApi'),
path('post/', views.CommentRating.postCommentVoteApi, name='postCommentVoteApi')
]
3 changes: 0 additions & 3 deletions practice-app/rate_post/tests.py

This file was deleted.

2 changes: 1 addition & 1 deletion practice-app/rate_post/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

urlpatterns = [
path('', views.indexRatePost, name='index'),
path('api/<int:pk>',views.postVote.as_view()),
path('api/<int:pk>',views.postVote.as_view(), name='api'),
path('get/', views.postVote.getVoteApi, name="getVoteApi"),
path('post/', views.postVote.postVoteApi, name="postVoteApi"),
]
1 change: 0 additions & 1 deletion practice-app/user/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ def test_poster_POST_email_not_valid(self):
self.assertEquals(response.data["error_code"], 6)
def test_poster_POST_email_not_valid(self):
response = self.client.post(self.userAPI_url,self.email_not_valid_2)
print(response.content)
self.assertEquals(response.status_code, 400)
self.assertEquals(response.data["error_code"], 7)

Expand Down
4 changes: 0 additions & 4 deletions practice-app/user/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ def post(self,req):
response = requests.request("GET", url, headers=headers, params=querystring)
isValid = response.json()["valid"]
explanation = response.json()["text"]
print(response.json())
if(isValid==False or explanation=="Should be blocked"):
return Response(data={"message":f"Email domain is not valid! {explanation}!","error_code":7},status=status.HTTP_400_BAD_REQUEST)
except:
Expand Down Expand Up @@ -123,7 +122,6 @@ def allUsers(req):
object.append(i["email"])

array.append(object)
print(array)
return render(req,"allUsers.html",{'profiles':array})

def createUser(req):
Expand All @@ -134,8 +132,6 @@ def createUser(req):


x = UserList.as_view()(request=req)
#x = requests.post(f"{next}/api", data = data)
print(x)

if(x.status_code==201):

Expand Down

0 comments on commit 0171ef8

Please sign in to comment.