# Path: shiori/bookmark/models.py
# class Category(BaseObject):
#     """ Category model """
#     category = models.CharField(max_length=255, unique=True)
# 
#     class Meta(object):
#         """ meta class """
#         db_table = 'category'
# 
#     def __unicode__(self):
#         return self.category
# 
# class Tag(BaseObject):
#     """ Tag model """
#     tag = models.CharField(max_length=255, unique=True)
# 
#     class Meta(object):
#         """ meta class """
#         db_table = 'tag'
# 
#     def __unicode__(self):
#         return self.tag
# 
# class Bookmark(BaseObject):
#     """ Bookmark model """
#     url = models.URLField()
#     title = models.CharField(max_length=255)
#     category = models.ForeignKey(Category)
#     tags = models.ManyToManyField(Tag, through='BookmarkTag')
#     registered_datetime = models.DateTimeField(auto_now=True,
#                                                auto_now_add=True)
#     description = models.TextField(blank=True)
#     owner = models.ForeignKey(User)
#     is_hide = models.BooleanField(default=False)
# 
#     class Meta(object):
#         """ meta class """
#         db_table = 'bookmark'
#         unique_together = ('url', 'owner')
# 
#     def __unicode__(self):
#         return self.title
# 
#     def get_absolute_url(self):
#         """ bookmark permalink path """
#         return "/shiori/b/%s" % self.id
# 
# Path: shiori/bookmark/feed_generator.py
# class LatestEntries(Feed):
#     """ Feed generator class """
#     title = 'Shiori new bookmarks'
#     link = '/shiori/'
#     description = 'Updates on changes and additions to Shiori.'
#     description_template = 'feeds/latest_title.html'
# 
#     def items(self):
#         """ Retrieve latest 5 bookmarks """
#         return Bookmark.objects.order_by('-registered_datetime')[:5]


from django.core.urlresolvers import resolve
from django.test import TestCase, TransactionTestCase
from django.contrib.auth.models import User
from django.views.generic import RedirectView
from django.db import IntegrityError
from shiori.bookmark.models import Category, Tag, Bookmark
from shiori.bookmark.feed_generator import LatestEntries
import shiori.bookmark.views
import shiori_tests.tests.vars as v
        self.assertContains(response,
                            'logout',
                            status_code=200)

    def test_profile_view(self):
        request = self.client.get('/shiori/profile')
        request.user = self.user
        response = shiori.bookmark.views.profile(request)
        self.assertContains(response,
                            'glyphicon-log-out',
                            status_code=200)

    def test_categories_view(self):
        request = self.client.get('/shiori/categories')
        request.user = self.user
        response = shiori.bookmark.views.categories(request)
        self.assertContains(response,
                            'categories_list',
                            status_code=200)

    def test_category_view(self):
        request = self.client.get('/shiori/category/dummy_id')
        request.user = self.user
        response = shiori.bookmark.views.category(request, 'dummy_id')
        self.assertContains(response,
                            'category_view',
                            status_code=200)

    def test_tags_view(self):
        request = self.client.get('/shiori/tags')

# Path: shiori/bookmark/models.py
# class Category(BaseObject):
#     """ Category model """
#     category = models.CharField(max_length=255, unique=True)
# 
#     class Meta(object):
#         """ meta class """
#         db_table = 'category'
# 
#     def __unicode__(self):
#         return self.category
# 
# class Tag(BaseObject):
#     """ Tag model """
#     tag = models.CharField(max_length=255, unique=True)
# 
#     class Meta(object):
#         """ meta class """
#         db_table = 'tag'
# 
#     def __unicode__(self):
#         return self.tag
# 
# class Bookmark(BaseObject):
#     """ Bookmark model """
#     url = models.URLField()
#     title = models.CharField(max_length=255)
#     category = models.ForeignKey(Category)
#     tags = models.ManyToManyField(Tag, through='BookmarkTag')
#     registered_datetime = models.DateTimeField(auto_now=True,
#                                                auto_now_add=True)
#     description = models.TextField(blank=True)
#     owner = models.ForeignKey(User)
#     is_hide = models.BooleanField(default=False)
# 
#     class Meta(object):
#         """ meta class """
#         db_table = 'bookmark'
#         unique_together = ('url', 'owner')
# 
#     def __unicode__(self):
#         return self.title
# 
#     def get_absolute_url(self):
#         """ bookmark permalink path """
#         return "/shiori/b/%s" % self.id
# 
# Path: shiori/bookmark/feed_generator.py
# class LatestEntries(Feed):
#     """ Feed generator class """
#     title = 'Shiori new bookmarks'
#     link = '/shiori/'
#     description = 'Updates on changes and additions to Shiori.'
#     description_template = 'feeds/latest_title.html'
# 
#     def items(self):
#         """ Retrieve latest 5 bookmarks """
#         return Bookmark.objects.order_by('-registered_datetime')[:5]


# Path: shiori_tests/tests/test_bookmark.py
from django.core.urlresolvers import resolve
from django.test import TestCase, TransactionTestCase
from django.contrib.auth.models import User
from django.views.generic import RedirectView
from django.db import IntegrityError
from shiori.bookmark.models import Category, Tag, Bookmark
from shiori.bookmark.feed_generator import LatestEntries
import shiori.bookmark.views
import shiori_tests.tests.vars as v

        self.assertContains(response,
                            'logout',
                            status_code=200)

    def test_profile_view(self):
        request = self.client.get('/shiori/profile')
        request.user = self.user
        response = shiori.bookmark.views.profile(request)
        self.assertContains(response,
                            'glyphicon-log-out',
                            status_code=200)

    def test_categories_view(self):
        request = self.client.get('/shiori/categories')
        request.user = self.user
        response = shiori.bookmark.views.categories(request)
        self.assertContains(response,
                            'categories_list',
                            status_code=200)

    def test_category_view(self):
        request = self.client.get('/shiori/category/dummy_id')
        request.user = self.user
        response = shiori.bookmark.views.category(request, 'dummy_id')
        self.assertContains(response,
                            'category_view',
                            status_code=200)

    def test_tags_view(self):
        request = self.client.get('/shiori/tags')

        request.user = self.user