Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#161254679 create, delete bookmark #43

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Eyansky
Copy link
Contributor

@Eyansky Eyansky commented Nov 15, 2018

What does this PR do?

  • User can create and delete bookmarks.

Description of Task to be completed?

  • As a user I can create a bookmark and delete a bookmark at any time i choose.

How should this be manually tested?

  • git clone this repo
$ git clone https://github.com/andela/ah-orcas
  • Navigate to this branch
$ git checkout ft-bookmarks-161254679
  • Setup the environments, see sample.env. Then install them.
$ source .env
  • Install the requirements.txt
$ pip install -r requirements.txt
  • run the migrations
$ ./release-tasks.sh
  • run the endpoint.
    Run in Postman

Any background context you want to provide?

  • N/A

What are the relevant pivotal tracker stories?

#161254679

Screenshots (if appropriate)

  • Bookmark article screenshot

screen shot 2018-11-15 at 22 35 53

  • Delete article screenshot

screen shot 2018-11-15 at 22 36 14

  • Some validation

screen shot 2018-11-15 at 22 36 45

authors/apps/article/likes_dislike_views.py Outdated Show resolved Hide resolved
authors/apps/article/renderers.py Outdated Show resolved Hide resolved
authors/apps/article/serializers.py Outdated Show resolved Hide resolved
authors/apps/article/models.py Outdated Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Nov 15, 2018

Pull Request Test Coverage Report for Build 693

  • 64 of 66 (96.97%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.6%) to 89.114%

Changes Missing Coverage Covered Lines Changed/Added Lines %
authors/apps/article/likes_dislike_views.py 4 5 80.0%
authors/apps/bookmark/views.py 39 40 97.5%
Totals Coverage Status
Change from base Build 625: 0.6%
Covered Lines: 966
Relevant Lines: 1084

💛 - Coveralls

@Eyansky Eyansky added the wip work in progress label Nov 15, 2018
authors/apps/bookmark/tests/test_bookmark.py Outdated Show resolved Hide resolved
authors/apps/bookmark/serializers.py Outdated Show resolved Hide resolved
authors/apps/bookmark/serializers.py Show resolved Hide resolved
authors/apps/bookmark/serializers.py Outdated Show resolved Hide resolved
authors/apps/bookmark/renderers.py Outdated Show resolved Hide resolved
authors/apps/bookmark/renderers.py Outdated Show resolved Hide resolved
authors/apps/bookmark/models.py Show resolved Hide resolved
authors/apps/article/serializers.py Show resolved Hide resolved
authors/apps/article/renderers.py Show resolved Hide resolved
from .models import Bookmark


class BookmarkAPIView(APIView):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

authors/apps/bookmark/renderers.py Outdated Show resolved Hide resolved
authors/apps/bookmark/serializers.py Show resolved Hide resolved
authors/apps/bookmark/models.py Show resolved Hide resolved
@Eyansky Eyansky force-pushed the ft-bookmarks-161254679 branch 2 times, most recently from 7778756 to 1b8f5f1 Compare November 15, 2018 21:42
renderer_classes = (BookmarkJSON,)
queryset = Bookmark.objects.all()

def post(self, request, slug):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

data["message"] = "bookmarked"
return Response(data, status.HTTP_200_OK)

def delete(self, request, slug):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

authors/apps/bookmark/renderers.py Outdated Show resolved Hide resolved
@Eyansky Eyansky force-pushed the ft-bookmarks-161254679 branch 2 times, most recently from 0f4a2d3 to d01cecb Compare November 16, 2018 06:20
@Eyansky Eyansky added Finished and removed wip work in progress labels Nov 16, 2018
authors/apps/bookmark/views.py Outdated Show resolved Hide resolved
authors/apps/bookmark/views.py Outdated Show resolved Hide resolved
- user can create bookmark
- user can delete bookmark

[Delivers #161254679]
@Eyansky Eyansky added wip work in progress and removed Finished labels Nov 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wip work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants