Commits

Anonymous committed 4f7e63f Draft

add test and fix

  • Participants
  • Parent commits eca28d7

Comments (0)

Files changed (19)

         https://github.com/jcrocholl/pep8/
     opml
         http://pypi.python.org/pypi/opml/0.5
-    Twitter bootstrap
-        http://twitter.github.com/bootstrap/
+    coverage
+        http://pypi.python.org/pypi/coverage/3.5.2
+    django-nose
+        https://github.com/jbalogh/django-nose 
 
 ## ChangeLog:

categories/models.py

         super(Categorie, self).save(*args, **kwargs)
 
     def get_absolute_url(self):
-        return "/categorie/%s/" % self.id
+        return "/categories/%s/" % self.id

categories/tests.py

-"""
-This file demonstrates writing tests using the unittest module. These will pass
-when you run "manage.py test".
-
-Replace this with more appropriate tests for your application.
-"""
-
-from django.test import TestCase
-
-
-class SimpleTest(TestCase):
-    def test_basic_addition(self):
-        """
-        Tests that 1 + 1 always equals 2.
-        """
-        self.assertEqual(1 + 1, 2)

categories/tests/__init__.py

+from categories.tests.models import *
+from categories.tests.views import *

categories/tests/models.py

+
+
+# -*- coding: utf-8 -*-
+
+"""
+This file demonstrates writing tests using the unittest module. These will pass
+when you run "manage.py test".
+
+Replace this with more appropriate tests for your application.
+"""
+
+from django.utils import unittest
+from django_nose.testcases import FastFixtureTestCase
+from django.utils import timezone
+from django.contrib.auth.models import User
+from django.conf import settings
+from categories.models import Categorie
+from feeds.models import Feed
+
+urls = 'minirss.urls'
+
+
+class ModelsTest(FastFixtureTestCase):
+    """ Test ensure models
+    """
+    def setUp(self):
+        # Create a test user
+        self.user = User.objects.create_user(
+            'test1',
+            'test@example.com',
+            'test')
+        self.user.is_active = True
+        self.user.save()
+        response = self.client.post('/admin/', {
+            'username': 'test',
+            'password': 'test',
+        })
+        self.assertEqual(response.status_code, 200)
+        self.client.login(username='test_other', password='test')
+
+    def test_model_add_categorie(self):
+        # Create categorie
+        self.categorie = Categorie(
+            title='premiere categorie',
+            slug='premiere-categorie')
+        self.categorie.content = 'Content lipsum hein!'
+        self.categorie.published = True
+        self.categorie.publish_date = timezone.now()
+        self.categorie.author = self.user
+
+        self.categorie.save()
+
+        # now check we can find it in the database again
+        all_categories_in_database = Categorie.objects.all()
+        self.assertEquals(len(all_categories_in_database), 10)
+        only_categorie_in_database = all_categories_in_database[0]
+        self.assertEquals(only_categorie_in_database, self.categorie)
+
+        # and check that it's saved its all attributes
+        self.assertEquals(only_categorie_in_database.title,
+                          'premiere categorie')
+        self.assertEquals(only_categorie_in_database.slug,
+                          'premiere-categorie')
+        self.assertEquals(only_categorie_in_database.content,
+                          'Content lipsum hein!')
+        self.assertEquals(only_categorie_in_database.published, True)
+        self.assertEquals(only_categorie_in_database.publish_date,
+                          self.categorie.publish_date)
+        self.assertEquals(only_categorie_in_database.author, self.user)
+
+    def test_model_delete_categorie(self):
+         # Create categorie
+        self.categorie = Categorie(
+            title='premiere categorie',
+            slug='premiere-categorie')
+        self.categorie.content = 'Content lipsum hein!'
+        self.categorie.published = True
+        self.categorie.publish_date = timezone.now()
+        self.categorie.author = self.user
+
+        self.categorie.save()
+
+        # delete categorie
+        categorie = Categorie.objects.get(pk=self.categorie.id)
+        categorie.delete()
+
+        response = self.client.get('/')
+        self.assertEqual(response.status_code, 200)
+        self.assertNotContains(
+            response,
+            self.categorie.title,
+            status_code=200)

categories/tests/views.py

+
+
+# -*- coding: utf-8 -*-
+
+"""
+This file demonstrates writing tests using the unittest module. These will pass
+when you run "manage.py test".
+
+Replace this with more appropriate tests for your application.
+"""
+
+from django.utils import unittest
+from django_nose.testcases import FastFixtureTestCase
+from django.utils import timezone
+from django.contrib.auth.models import User
+from django.conf import settings
+from categories.models import Categorie
+from feeds.models import Feed
+import re
+
+urls = 'minirss.urls'
+
+
+class ViewsTest(FastFixtureTestCase):
+    """ Test ensure views
+    """
+    def setUp(self):
+        # Create a test user
+        self.user = User.objects.create_user(
+            'test1',
+            'test@example.com',
+            'test')
+        self.user.is_active = True
+        self.user.save()
+        response = self.client.post('/admin/', {
+            'username': 'test',
+            'password': 'test',
+        })
+        self.assertEqual(response.status_code, 200)
+        self.client.login(username='test_other', password='test')
+
+        # Create categorie
+        self.categorie = Categorie(
+            title='premiere categorie',
+            slug='premiere-categorie')
+        self.categorie.content = 'Content lipsum hein!'
+        self.categorie.published = True
+        self.categorie.publish_date = timezone.now()
+        self.categorie.author = self.user
+
+        self.categorie.save()
+
+    def get_csrf_token(self):
+        # Scrap CSRF token
+        response = self.client.get('/admin/login/')
+        csrf_regex = r'csrfmiddlewaretoken\'\s+value=\'(\w+)\''
+        csrf_regex = r'value=\'(\w+)\''
+        return re.search(csrf_regex, response.content).groups()[0]
+
+    def test_view_recent_categorie(self):
+        # Get categorie for home page
+        self.client.login(username='test', password='test')
+        response = self.client.get('/')
+        self.assertContains(
+            response,
+            self.categorie.content,
+            status_code=200)
+
+    def test_view_detail_categorie(self):
+        # Get categorie for detail
+        self.client.login(username='test', password='test')
+        response = self.client.get(self.categorie.get_absolute_url())
+        self.assertEqual(response.status_code, 200)
+        self.assertContains(
+            response,
+            self.categorie.content,
+            status_code=200)

feeds/templatetags/feeds.py

-
+
 
 # -*- coding: utf-8 -*-
 from django import template
 
 register = template.Library()
 
+
 @register.inclusion_tag('minirss/display_feeds.html')
-def read_feed_cache(feed_url, feed_id, feed_title, posts_to_show=5, cache_expires=30):
-    CACHE_FILE = ''.join([settings.CACHE_FOLDER, template.defaultfilters.slugify(feed_url), '.cache'])
+def read_feed_cache(feed_url, feed_id, feed_title,
+                    posts_to_show=5, cache_expires=30):
+    CACHE_FILE = ''.join([settings.CACHE_FOLDER,
+                          template.defaultfilters.slugify(feed_url), '.cache'])
     try:
         cache_age = os.stat(CACHE_FILE)[8]
-    except: 
+    except:
         cache_age = 0
 
-    if (cache_age + cache_expires*60 < time.time()):
-        try: 
-            urllib.urlretrieve(feed_url,CACHE_FILE)
+    if (cache_age + cache_expires * 60 < time.time()):
+        try:
+            urllib.urlretrieve(feed_url, CACHE_FILE)
         except IOError:
             pass
 
     feed = feedparser.parse(open(CACHE_FILE))
     posts = []
-    if len(feed['items']) < posts_to_show: # fix bug list out of range
+    if len(feed['items']) < posts_to_show:  # fix bug list out of range
         posts_to_show = 2
     for i in range(posts_to_show):
         try:
             # for Atom
             title = feed.entries[i].title
             # format date
-            updated = datetime.datetime.strptime(feed.entries[i].updated[:19], '%Y-%m-%dT%H:%M:%S')
+            updated = datetime.datetime.strptime(
+                feed.entries[i].updated[:19], '%Y-%m-%dT%H:%M:%S')
             summary = feed.entries[i].summary
         except:
-            # for RSS
-            title = feed.entries[i].title
-            updated = ''
-            summary = '<a href="%s">%s</a>' % (feed.entries[i].link, feed.entries[i].link)
+            break
 
         posts.append({
             'id': i,

feeds/tests.py

-"""
-This file demonstrates writing tests using the unittest module. These will pass
-when you run "manage.py test".
-
-Replace this with more appropriate tests for your application.
-"""
-
-from django.test import TestCase
-
-
-class SimpleTest(TestCase):
-    def test_basic_addition(self):
-        """
-        Tests that 1 + 1 always equals 2.
-        """
-        self.assertEqual(1 + 1, 2)

feeds/tests/__init__.py

+from feeds.tests.models import *
+from feeds.tests.views import *

feeds/tests/models.py

+
+
+# -*- coding: utf-8 -*-
+
+"""
+This file demonstrates writing tests using the unittest module. These will pass
+when you run "manage.py test".
+
+Replace this with more appropriate tests for your application.
+"""
+
+from django_nose.testcases import FastFixtureTestCase
+from django.contrib.auth.models import User
+from django.utils import timezone
+from django.conf import settings
+from categories.models import Categorie
+from feeds.models import Feed
+import re
+
+urls = 'minirss.urls'
+
+
+class ModelsTest(FastFixtureTestCase):
+    """ Test ensure models
+    """
+    def setUp(self):
+        # Create a test user
+        self.user = User.objects.create_user(
+            'test1',
+            'test@example.com',
+            'test')
+        self.user.is_active = True
+        self.user.save()
+        response = self.client.post('/admin/', {
+            'username': 'test',
+            'password': 'test',
+        })
+        self.assertEqual(response.status_code, 200)
+        self.client.login(username='test_other', password='test')
+
+    def test_model_add_feed(self):
+        # Create categorie
+        self.categorie = Categorie(
+            title='premiere categorie',
+            slug='premiere-categorie')
+        self.categorie.content = 'Content lipsum hein!'
+        self.categorie.published = True
+        self.categorie.publish_date = timezone.now()
+        self.categorie.author = self.user
+
+        self.categorie.save()
+
+        # Create feed
+        self.feed = Feed(
+            title='ilian.i-n-i.org')
+        self.feed.categorie = self.categorie
+        self.feed.url_feed = 'http://ilian.i-n-i.org/feed/'
+        self.feed.author = self.user
+        self.feed.publish_date = timezone.now()
+
+        self.feed.save()
+
+        # now check we can find it in the database again
+        all_feeds_in_database = Feed.objects.all()
+        self.assertEquals(len(all_feeds_in_database), 13)
+        only_feed_in_database = all_feeds_in_database[12]
+        self.assertEquals(only_feed_in_database, self.feed)
+
+        # and check that it's saved its all attributes
+        self.assertEquals(only_feed_in_database.title, 'ilian.i-n-i.org')
+        self.assertEquals(only_feed_in_database.categorie, self.categorie)
+        self.assertEquals(only_feed_in_database.url_feed,
+                          'http://ilian.i-n-i.org/feed/')
+        self.assertEquals(only_feed_in_database.publish_date,
+                          self.feed.publish_date)
+        self.assertEquals(only_feed_in_database.author, self.user)
+
+    def test_model_delete_feeds(self):
+         # Create categorie
+        self.categorie = Categorie(
+            title='premiere categorie',
+            slug='premiere-categorie')
+        self.categorie.content = 'Content lipsum hein!'
+        self.categorie.published = True
+        self.categorie.publish_date = timezone.now()
+        self.categorie.author = self.user
+
+        self.categorie.save()
+
+        # Create feed
+        self.feed = Feed(
+            title='ilian.i-n-i.org')
+        self.feed.categorie = self.categorie
+        self.feed.url_feed = 'http://ilian.i-n-i.org/feed/'
+        self.feed.author = self.user
+        self.feed.publish_date = timezone.now()
+
+        self.feed.save()
+
+        # delete feed
+        feed = Feed.objects.get(pk=self.feed.id)
+        feed.delete()
+
+        response = self.client.get('/')
+        self.assertEqual(response.status_code, 200)
+        self.assertNotContains(
+            response,
+            self.feed.title,
+            status_code=200)

feeds/tests/views.py

+
+
+# -*- coding: utf-8 -*-
+
+"""
+This file demonstrates writing tests using the unittest module. These will pass
+when you run "manage.py test".
+
+Replace this with more appropriate tests for your application.
+"""
+
+from django_nose.testcases import FastFixtureTestCase
+from django.contrib.auth.models import User
+from django.utils import timezone
+from django.conf import settings
+from categories.models import Categorie
+from feeds.models import Feed
+import re
+
+urls = 'minirss.urls'
+
+
+class ViewsTest(FastFixtureTestCase):
+    """ Test ensure views
+    """
+    def setUp(self):
+        # Create a test user
+        self.user = User.objects.create_user(
+            'test1',
+            'test@example.com',
+            'test')
+        self.user.is_active = True
+        self.user.save()
+        response = self.client.post('/admin/', {
+            'username': 'test',
+            'password': 'test',
+        })
+        self.assertEqual(response.status_code, 200)
+        self.client.login(username='test_other', password='test')
+
+        # Create categorie
+        self.categorie = Categorie(
+            title='premiere categorie',
+            slug='premiere-categorie')
+        self.categorie.content = 'Content lipsum hein!'
+        self.categorie.published = True
+        self.categorie.publish_date = timezone.now()
+        self.categorie.author = self.user
+
+        self.categorie.save()
+
+        # Create feed
+        self.feed = Feed(
+            title='ilian.i-n-i.org')
+        self.feed.categorie = self.categorie
+        self.feed.url_feed = 'http://ilian.i-n-i.org/feed/'
+        self.feed.author = self.user
+        self.feed.publish_date = timezone.now()
+
+        self.feed.save()
+
+    def get_csrf_token(self):
+        # Scrap CSRF token
+        response = self.client.get('/admin/login/')
+        csrf_regex = r'csrfmiddlewaretoken\'\s+value=\'(\w+)\''
+        csrf_regex = r'value=\'(\w+)\''
+        return re.search(csrf_regex, response.content).groups()[0]
+
+    def test_view_detail_feeds(self):
+        # Get feeds for detail
+        response = self.client.get(self.feed.get_absolute_url())
+        self.assertContains(
+            response,
+            self.feed.title,
+            status_code=200)

minirss/fixtures/initial_data.json

+[{"pk": 8, "model": "contenttypes.contenttype", "fields": {"model": "categorie", "name": "categorie", "app_label": "categories"}}, {"pk": 4, "model": "contenttypes.contenttype", "fields": {"model": "contenttype", "name": "content type", "app_label": "contenttypes"}}, {"pk": 9, "model": "contenttypes.contenttype", "fields": {"model": "feed", "name": "feed", "app_label": "feeds"}}, {"pk": 2, "model": "contenttypes.contenttype", "fields": {"model": "group", "name": "group", "app_label": "auth"}}, {"pk": 7, "model": "contenttypes.contenttype", "fields": {"model": "logentry", "name": "log entry", "app_label": "admin"}}, {"pk": 1, "model": "contenttypes.contenttype", "fields": {"model": "permission", "name": "permission", "app_label": "auth"}}, {"pk": 5, "model": "contenttypes.contenttype", "fields": {"model": "session", "name": "session", "app_label": "sessions"}}, {"pk": 6, "model": "contenttypes.contenttype", "fields": {"model": "site", "name": "site", "app_label": "sites"}}, {"pk": 3, "model": "contenttypes.contenttype", "fields": {"model": "user", "name": "user", "app_label": "auth"}}, {"pk": "4d14685da9267ee3b701eec9ca2d307d", "model": "sessions.session", "fields": {"expire_date": "2012-07-10T16:43:35.856", "session_data": "ODAzNDkzYzY1YmJjMDQ0YWQ3MjBhMzI4MmQ3ZWJjYTMwOTFiNGM1MzqAAn1xAShVEl9hdXRoX3Vz\nZXJfYmFja2VuZHECVSlkamFuZ28uY29udHJpYi5hdXRoLmJhY2tlbmRzLk1vZGVsQmFja2VuZHED\nVQ1fYXV0aF91c2VyX2lkcQRLAXUu\n"}}, {"pk": "d26d0b7105309733ee0e536e42ad0582", "model": "sessions.session", "fields": {"expire_date": "2012-07-11T15:35:11.588", "session_data": "ODAzNDkzYzY1YmJjMDQ0YWQ3MjBhMzI4MmQ3ZWJjYTMwOTFiNGM1MzqAAn1xAShVEl9hdXRoX3Vz\nZXJfYmFja2VuZHECVSlkamFuZ28uY29udHJpYi5hdXRoLmJhY2tlbmRzLk1vZGVsQmFja2VuZHED\nVQ1fYXV0aF91c2VyX2lkcQRLAXUu\n"}}, {"pk": "c60ee393eb5d801ae6b4574326156f8e", "model": "sessions.session", "fields": {"expire_date": "2012-08-03T00:04:31.803", "session_data": "ODAzNDkzYzY1YmJjMDQ0YWQ3MjBhMzI4MmQ3ZWJjYTMwOTFiNGM1MzqAAn1xAShVEl9hdXRoX3Vz\nZXJfYmFja2VuZHECVSlkamFuZ28uY29udHJpYi5hdXRoLmJhY2tlbmRzLk1vZGVsQmFja2VuZHED\nVQ1fYXV0aF91c2VyX2lkcQRLAXUu\n"}}, {"pk": 1, "model": "sites.site", "fields": {"domain": "example.com", "name": "example.com"}}, {"pk": 19, "model": "auth.permission", "fields": {"codename": "add_logentry", "name": "Can add log entry", "content_type": ["admin", "logentry"]}}, {"pk": 20, "model": "auth.permission", "fields": {"codename": "change_logentry", "name": "Can change log entry", "content_type": ["admin", "logentry"]}}, {"pk": 21, "model": "auth.permission", "fields": {"codename": "delete_logentry", "name": "Can delete log entry", "content_type": ["admin", "logentry"]}}, {"pk": 1, "model": "auth.permission", "fields": {"codename": "add_group", "name": "Can add group", "content_type": ["auth", "group"]}}, {"pk": 4, "model": "auth.permission", "fields": {"codename": "change_group", "name": "Can change group", "content_type": ["auth", "group"]}}, {"pk": 7, "model": "auth.permission", "fields": {"codename": "delete_group", "name": "Can delete group", "content_type": ["auth", "group"]}}, {"pk": 2, "model": "auth.permission", "fields": {"codename": "add_permission", "name": "Can add permission", "content_type": ["auth", "permission"]}}, {"pk": 5, "model": "auth.permission", "fields": {"codename": "change_permission", "name": "Can change permission", "content_type": ["auth", "permission"]}}, {"pk": 8, "model": "auth.permission", "fields": {"codename": "delete_permission", "name": "Can delete permission", "content_type": ["auth", "permission"]}}, {"pk": 3, "model": "auth.permission", "fields": {"codename": "add_user", "name": "Can add user", "content_type": ["auth", "user"]}}, {"pk": 6, "model": "auth.permission", "fields": {"codename": "change_user", "name": "Can change user", "content_type": ["auth", "user"]}}, {"pk": 9, "model": "auth.permission", "fields": {"codename": "delete_user", "name": "Can delete user", "content_type": ["auth", "user"]}}, {"pk": 22, "model": "auth.permission", "fields": {"codename": "add_categorie", "name": "Can add categorie", "content_type": ["categories", "categorie"]}}, {"pk": 23, "model": "auth.permission", "fields": {"codename": "change_categorie", "name": "Can change categorie", "content_type": ["categories", "categorie"]}}, {"pk": 24, "model": "auth.permission", "fields": {"codename": "delete_categorie", "name": "Can delete categorie", "content_type": ["categories", "categorie"]}}, {"pk": 10, "model": "auth.permission", "fields": {"codename": "add_contenttype", "name": "Can add content type", "content_type": ["contenttypes", "contenttype"]}}, {"pk": 11, "model": "auth.permission", "fields": {"codename": "change_contenttype", "name": "Can change content type", "content_type": ["contenttypes", "contenttype"]}}, {"pk": 12, "model": "auth.permission", "fields": {"codename": "delete_contenttype", "name": "Can delete content type", "content_type": ["contenttypes", "contenttype"]}}, {"pk": 25, "model": "auth.permission", "fields": {"codename": "add_feed", "name": "Can add feed", "content_type": ["feeds", "feed"]}}, {"pk": 26, "model": "auth.permission", "fields": {"codename": "change_feed", "name": "Can change feed", "content_type": ["feeds", "feed"]}}, {"pk": 27, "model": "auth.permission", "fields": {"codename": "delete_feed", "name": "Can delete feed", "content_type": ["feeds", "feed"]}}, {"pk": 13, "model": "auth.permission", "fields": {"codename": "add_session", "name": "Can add session", "content_type": ["sessions", "session"]}}, {"pk": 14, "model": "auth.permission", "fields": {"codename": "change_session", "name": "Can change session", "content_type": ["sessions", "session"]}}, {"pk": 15, "model": "auth.permission", "fields": {"codename": "delete_session", "name": "Can delete session", "content_type": ["sessions", "session"]}}, {"pk": 16, "model": "auth.permission", "fields": {"codename": "add_site", "name": "Can add site", "content_type": ["sites", "site"]}}, {"pk": 17, "model": "auth.permission", "fields": {"codename": "change_site", "name": "Can change site", "content_type": ["sites", "site"]}}, {"pk": 18, "model": "auth.permission", "fields": {"codename": "delete_site", "name": "Can delete site", "content_type": ["sites", "site"]}}, {"pk": 1, "model": "auth.user", "fields": {"username": "test", "first_name": "", "last_name": "", "is_active": true, "is_superuser": true, "is_staff": true, "last_login": "2012-07-20T00:04:31.771", "groups": [], "user_permissions": [], "password": "pbkdf2_sha256$10000$wjcHNuuCZPAu$7ygvr9Bmw+fEHNBAi7/5oOEMpWHeYOTNWg5PG8+T+cw=", "email": "test@admin.com", "date_joined": "2012-06-26T16:43:25"}}, {"pk": 65, "model": "admin.logentry", "fields": {"action_flag": 2, "action_time": "2012-07-20T00:03:51.121", "object_repr": "test", "object_id": "1", "change_message": "Modifi\u00e9 username, password et email.", "user": ["test"], "content_type": ["auth", "user"]}}, {"pk": 64, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-07-20T00:03:36.090", "object_repr": "test", "object_id": "2", "change_message": "", "user": ["test"], "content_type": ["auth", "user"]}}, {"pk": 63, "model": "admin.logentry", "fields": {"action_flag": 2, "action_time": "2012-07-20T00:03:12.078", "object_repr": "test", "object_id": "2", "change_message": "Modifi\u00e9 password et is_staff.", "user": ["test"], "content_type": ["auth", "user"]}}, {"pk": 62, "model": "admin.logentry", "fields": {"action_flag": 2, "action_time": "2012-07-20T00:03:02.740", "object_repr": "test", "object_id": "2", "change_message": "Modifi\u00e9 password et is_superuser.", "user": ["test"], "content_type": ["auth", "user"]}}, {"pk": 61, "model": "admin.logentry", "fields": {"action_flag": 1, "action_time": "2012-07-20T00:02:50.261", "object_repr": "test", "object_id": "2", "change_message": "", "user": ["test"], "content_type": ["auth", "user"]}}, {"pk": 60, "model": "admin.logentry", "fields": {"action_flag": 1, "action_time": "2012-07-03T19:03:13.124", "object_repr": "donneesouvertes.info, 2012-07-03 19:03:03", "object_id": "14", "change_message": "", "user": ["test"], "content_type": ["feeds", "feed"]}}, {"pk": 59, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-07-03T19:02:55.365", "object_repr": "donneesouvertes.info, 2012-07-02 19:03:31.080459", "object_id": "12", "change_message": "", "user": ["test"], "content_type": ["feeds", "feed"]}}, {"pk": 58, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-07-03T19:02:55.345", "object_repr": "blog.zouzzzz.info, 2012-06-27 02:21:29", "object_id": "1", "change_message": "", "user": ["test"], "content_type": ["feeds", "feed"]}}, {"pk": 57, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-07-02T18:53:47.351", "object_repr": "geek news", "object_id": "3", "change_message": "", "user": ["test"], "content_type": ["categories", "categorie"]}}, {"pk": 56, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-07-02T18:53:47.334", "object_repr": "bonne lecture", "object_id": "4", "change_message": "", "user": ["test"], "content_type": ["categories", "categorie"]}}, {"pk": 55, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-07-02T18:53:47.318", "object_repr": "Browser", "object_id": "5", "change_message": "", "user": ["test"], "content_type": ["categories", "categorie"]}}, {"pk": 54, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-07-02T18:53:47.300", "object_repr": "GNU/Linux", "object_id": "6", "change_message": "", "user": ["test"], "content_type": ["categories", "categorie"]}}, {"pk": 53, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-07-02T18:53:47.286", "object_repr": "python", "object_id": "7", "change_message": "", "user": ["test"], "content_type": ["categories", "categorie"]}}, {"pk": 52, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-07-02T18:53:47.259", "object_repr": "HTML", "object_id": "8", "change_message": "", "user": ["test"], "content_type": ["categories", "categorie"]}}, {"pk": 51, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-07-02T18:53:47.242", "object_repr": "OpenData", "object_id": "9", "change_message": "", "user": ["test"], "content_type": ["categories", "categorie"]}}, {"pk": 50, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-07-02T18:52:37.026", "object_repr": "geek news", "object_id": "3", "change_message": "", "user": ["test"], "content_type": ["categories", "categorie"]}}, {"pk": 49, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-07-02T18:52:37.008", "object_repr": "bonne lecture", "object_id": "4", "change_message": "", "user": ["test"], "content_type": ["categories", "categorie"]}}, {"pk": 48, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-07-02T18:52:36.991", "object_repr": "Browser", "object_id": "5", "change_message": "", "user": ["test"], "content_type": ["categories", "categorie"]}}, {"pk": 47, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-07-02T18:52:36.977", "object_repr": "GNU/Linux", "object_id": "6", "change_message": "", "user": ["test"], "content_type": ["categories", "categorie"]}}, {"pk": 46, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-07-02T18:52:36.962", "object_repr": "python", "object_id": "7", "change_message": "", "user": ["test"], "content_type": ["categories", "categorie"]}}, {"pk": 45, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-07-02T18:52:36.942", "object_repr": "HTML", "object_id": "8", "change_message": "", "user": ["test"], "content_type": ["categories", "categorie"]}}, {"pk": 44, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-07-02T18:52:36.923", "object_repr": "OpenData", "object_id": "9", "change_message": "", "user": ["test"], "content_type": ["categories", "categorie"]}}, {"pk": 43, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-07-02T18:51:11.205", "object_repr": "geek news", "object_id": "3", "change_message": "", "user": ["test"], "content_type": ["categories", "categorie"]}}, {"pk": 42, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-07-02T18:51:11.188", "object_repr": "bonne lecture", "object_id": "4", "change_message": "", "user": ["test"], "content_type": ["categories", "categorie"]}}, {"pk": 41, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-07-02T18:51:11.171", "object_repr": "Browser", "object_id": "5", "change_message": "", "user": ["test"], "content_type": ["categories", "categorie"]}}, {"pk": 40, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-07-02T18:51:11.155", "object_repr": "GNU/Linux", "object_id": "6", "change_message": "", "user": ["test"], "content_type": ["categories", "categorie"]}}, {"pk": 39, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-07-02T18:51:11.138", "object_repr": "python", "object_id": "7", "change_message": "", "user": ["test"], "content_type": ["categories", "categorie"]}}, {"pk": 38, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-07-02T18:51:11.124", "object_repr": "HTML", "object_id": "8", "change_message": "", "user": ["test"], "content_type": ["categories", "categorie"]}}, {"pk": 37, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-07-02T18:51:11.102", "object_repr": "OpenData", "object_id": "9", "change_message": "", "user": ["test"], "content_type": ["categories", "categorie"]}}, {"pk": 36, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-07-02T16:47:46.522", "object_repr": "geek news", "object_id": "3", "change_message": "", "user": ["test"], "content_type": ["categories", "categorie"]}}, {"pk": 35, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-07-02T16:29:17.413", "object_repr": "geek news", "object_id": "3", "change_message": "", "user": ["test"], "content_type": ["categories", "categorie"]}}, {"pk": 34, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-07-02T16:09:51.491", "object_repr": "geek news", "object_id": "3", "change_message": "", "user": ["test"], "content_type": ["categories", "categorie"]}}, {"pk": 33, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-07-02T16:08:46.213", "object_repr": "geek news", "object_id": "3", "change_message": "", "user": ["test"], "content_type": ["categories", "categorie"]}}, {"pk": 32, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-07-02T15:49:49.679", "object_repr": "geek news", "object_id": "3", "change_message": "", "user": ["test"], "content_type": ["categories", "categorie"]}}, {"pk": 31, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-07-02T15:48:39.999", "object_repr": "geek news", "object_id": "3", "change_message": "", "user": ["test"], "content_type": ["categories", "categorie"]}}, {"pk": 30, "model": "admin.logentry", "fields": {"action_flag": 1, "action_time": "2012-06-29T13:57:08.633", "object_repr": "www.lipousse.org, 2012-06-29 15:57:03+02:00", "object_id": "2", "change_message": "", "user": ["test"], "content_type": ["feeds", "feed"]}}, {"pk": 29, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-06-27T16:04:25.853", "object_repr": "feeds.feedburner.com, 2012-06-27 15:44:43+00:00", "object_id": "2", "change_message": "", "user": ["test"], "content_type": ["feeds", "feed"]}}, {"pk": 28, "model": "admin.logentry", "fields": {"action_flag": 1, "action_time": "2012-06-27T15:45:05.157", "object_repr": "feeds.feedburner.com, 2012-06-27 17:44:43+02:00", "object_id": "2", "change_message": "", "user": ["test"], "content_type": ["feeds", "feed"]}}, {"pk": 27, "model": "admin.logentry", "fields": {"action_flag": 1, "action_time": "2012-06-27T02:21:40.263", "object_repr": "blog.zouzzzz.info, 2012-06-27 04:21:29+02:00", "object_id": "1", "change_message": "", "user": ["test"], "content_type": ["feeds", "feed"]}}, {"pk": 26, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-06-27T02:21:27.392", "object_repr": "larlet.fr, 2012-06-27 01:53:16+00:00", "object_id": "5", "change_message": "", "user": ["test"], "content_type": ["feeds", "feed"]}}, {"pk": 25, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-06-27T02:21:27.375", "object_repr": "standblog.org, 2012-06-27 01:19:41+00:00", "object_id": "4", "change_message": "", "user": ["test"], "content_type": ["feeds", "feed"]}}, {"pk": 24, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-06-27T02:21:27.358", "object_repr": "embruns.net, 2012-06-27 01:19:31+00:00", "object_id": "3", "change_message": "", "user": ["test"], "content_type": ["feeds", "feed"]}}, {"pk": 23, "model": "admin.logentry", "fields": {"action_flag": 1, "action_time": "2012-06-27T01:53:34.456", "object_repr": "larlet.fr, 2012-06-27 03:53:16+02:00", "object_id": "5", "change_message": "", "user": ["test"], "content_type": ["feeds", "feed"]}}, {"pk": 22, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-06-27T01:52:16.294", "object_repr": "soymalau.com, 2012-06-27 00:13:26+00:00", "object_id": "2", "change_message": "", "user": ["test"], "content_type": ["feeds", "feed"]}}, {"pk": 21, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-06-27T01:52:16.275", "object_repr": "larlet.fr, 2012-06-26 16:45:39+00:00", "object_id": "1", "change_message": "", "user": ["test"], "content_type": ["feeds", "feed"]}}, {"pk": 20, "model": "admin.logentry", "fields": {"action_flag": 1, "action_time": "2012-06-27T01:19:50.765", "object_repr": "standblog.org, 2012-06-27 03:19:41+02:00", "object_id": "4", "change_message": "", "user": ["test"], "content_type": ["feeds", "feed"]}}, {"pk": 19, "model": "admin.logentry", "fields": {"action_flag": 1, "action_time": "2012-06-27T01:19:38.648", "object_repr": "embruns.net, 2012-06-27 03:19:31+02:00", "object_id": "3", "change_message": "", "user": ["test"], "content_type": ["feeds", "feed"]}}, {"pk": 18, "model": "admin.logentry", "fields": {"action_flag": 1, "action_time": "2012-06-27T00:13:40.049", "object_repr": "soymalau.com, 2012-06-27 02:13:26+02:00", "object_id": "2", "change_message": "", "user": ["test"], "content_type": ["feeds", "feed"]}}, {"pk": 17, "model": "admin.logentry", "fields": {"action_flag": 2, "action_time": "2012-06-27T00:12:57.744", "object_repr": "larlet.fr, 2012-06-26 18:45:39+02:00", "object_id": "1", "change_message": "Modifi\u00e9 url_feed.", "user": ["test"], "content_type": ["feeds", "feed"]}}, {"pk": 16, "model": "admin.logentry", "fields": {"action_flag": 2, "action_time": "2012-06-26T23:56:02.943", "object_repr": "embruns.net, 2012-06-26 18:45:39+02:00", "object_id": "1", "change_message": "Modifi\u00e9 url_feed.", "user": ["test"], "content_type": ["feeds", "feed"]}}, {"pk": 15, "model": "admin.logentry", "fields": {"action_flag": 2, "action_time": "2012-06-26T23:54:24.797", "object_repr": "larlet.fr, 2012-06-26 18:45:39+02:00", "object_id": "1", "change_message": "Modifi\u00e9 url_feed.", "user": ["test"], "content_type": ["feeds", "feed"]}}, {"pk": 14, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-06-26T23:10:17.124", "object_repr": "embruns.net, 2012-06-26 22:36:52+00:00", "object_id": "3", "change_message": "", "user": ["test"], "content_type": ["feeds", "feed"]}}, {"pk": 13, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-06-26T23:10:17.106", "object_repr": "openweb.eu.org, 2012-06-26 22:36:27+00:00", "object_id": "2", "change_message": "", "user": ["test"], "content_type": ["feeds", "feed"]}}, {"pk": 12, "model": "admin.logentry", "fields": {"action_flag": 1, "action_time": "2012-06-26T22:37:01.969", "object_repr": "embruns.net, 2012-06-27 00:36:52+02:00", "object_id": "3", "change_message": "", "user": ["test"], "content_type": ["feeds", "feed"]}}, {"pk": 11, "model": "admin.logentry", "fields": {"action_flag": 1, "action_time": "2012-06-26T22:36:36.587", "object_repr": "openweb.eu.org, 2012-06-27 00:36:27+02:00", "object_id": "2", "change_message": "", "user": ["test"], "content_type": ["feeds", "feed"]}}, {"pk": 10, "model": "admin.logentry", "fields": {"action_flag": 2, "action_time": "2012-06-26T22:35:59.218", "object_repr": "blog.zouzzzz.info, 2012-06-26 18:45:39+02:00", "object_id": "1", "change_message": "Aucun champ modifi\u00e9.", "user": ["test"], "content_type": ["feeds", "feed"]}}, {"pk": 9, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-06-26T22:28:27.976", "object_repr": "standblog.org, 2012-06-26 16:49:45+00:00", "object_id": "2", "change_message": "", "user": ["test"], "content_type": ["feeds", "feed"]}}, {"pk": 8, "model": "admin.logentry", "fields": {"action_flag": 2, "action_time": "2012-06-26T21:41:55.610", "object_repr": "blog.zouzzzz.info, 2012-06-26 18:45:39+02:00", "object_id": "1", "change_message": "Modifi\u00e9 url_feed.", "user": ["test"], "content_type": ["feeds", "feed"]}}, {"pk": 7, "model": "admin.logentry", "fields": {"action_flag": 1, "action_time": "2012-06-26T16:49:54.362", "object_repr": "standblog.org, 2012-06-26 18:49:45+02:00", "object_id": "2", "change_message": "", "user": ["test"], "content_type": ["feeds", "feed"]}}, {"pk": 6, "model": "admin.logentry", "fields": {"action_flag": 1, "action_time": "2012-06-26T16:49:18.787", "object_repr": "Two", "object_id": "2", "change_message": "", "user": ["test"], "content_type": ["categories", "categorie"]}}, {"pk": 5, "model": "admin.logentry", "fields": {"action_flag": 2, "action_time": "2012-06-26T16:47:51.381", "object_repr": "embruns.net, 2012-06-26 18:45:39+02:00", "object_id": "1", "change_message": "Aucun champ modifi\u00e9.", "user": ["test"], "content_type": ["feeds", "feed"]}}, {"pk": 4, "model": "admin.logentry", "fields": {"action_flag": 1, "action_time": "2012-06-26T16:45:45.985", "object_repr": "httpembrunsnetatomxml, 2012-06-26 18:45:39+02:00", "object_id": "1", "change_message": "", "user": ["test"], "content_type": ["feeds", "feed"]}}, {"pk": 3, "model": "admin.logentry", "fields": {"action_flag": 3, "action_time": "2012-06-26T16:45:06.490", "object_repr": ", 2012-06-26 16:44:29+00:00", "object_id": "1", "change_message": "", "user": ["test"], "content_type": ["feeds", "feed"]}}, {"pk": 2, "model": "admin.logentry", "fields": {"action_flag": 1, "action_time": "2012-06-26T16:44:37.925", "object_repr": ", 2012-06-26 18:44:29+02:00", "object_id": "1", "change_message": "", "user": ["test"], "content_type": ["feeds", "feed"]}}, {"pk": 1, "model": "admin.logentry", "fields": {"action_flag": 1, "action_time": "2012-06-26T16:44:17.529", "object_repr": "One", "object_id": "1", "change_message": "", "user": ["test"], "content_type": ["categories", "categorie"]}}, {"pk": 9, "model": "categories.categorie", "fields": {"author": ["test"], "title": "OpenData", "content": "", "publish_date": "2012-07-02T19:03:31.021", "published": true, "slug": "opendata"}}, {"pk": 8, "model": "categories.categorie", "fields": {"author": ["test"], "title": "HTML", "content": "", "publish_date": "2012-07-02T19:03:30.901", "published": true, "slug": "html"}}, {"pk": 7, "model": "categories.categorie", "fields": {"author": ["test"], "title": "python", "content": "", "publish_date": "2012-07-02T19:03:30.769", "published": true, "slug": "python"}}, {"pk": 6, "model": "categories.categorie", "fields": {"author": ["test"], "title": "GNU/Linux", "content": "", "publish_date": "2012-07-02T19:03:30.710", "published": true, "slug": "gnulinux"}}, {"pk": 5, "model": "categories.categorie", "fields": {"author": ["test"], "title": "Browser", "content": "", "publish_date": "2012-07-02T19:03:30.658", "published": true, "slug": "browser"}}, {"pk": 4, "model": "categories.categorie", "fields": {"author": ["test"], "title": "bonne lecture", "content": "", "publish_date": "2012-07-02T19:03:30.476", "published": true, "slug": "bonne-lecture"}}, {"pk": 3, "model": "categories.categorie", "fields": {"author": ["test"], "title": "geek news", "content": "", "publish_date": "2012-07-02T19:03:30.136", "published": true, "slug": "geek-news"}}, {"pk": 2, "model": "categories.categorie", "fields": {"author": ["test"], "title": "Two", "content": "Categorie Two\r\n<br>\r\n", "publish_date": "2012-06-26T16:48:54", "published": true, "slug": "two"}}, {"pk": 1, "model": "categories.categorie", "fields": {"author": ["test"], "title": "One", "content": "Categorie One\r\n<br>\r\n", "publish_date": "2012-06-26T16:43:52", "published": true, "slug": "one"}}, {"pk": 2, "model": "feeds.feed", "fields": {"publish_date": "2012-06-29T13:57:03", "title": "www.lipousse.org", "categorie": 2, "url_feed": "http://www.lipousse.org/dotclear/index.php/feed/atom", "author": ["test"]}}, {"pk": 3, "model": "feeds.feed", "fields": {"publish_date": "2012-07-02T19:03:30.187", "title": "news.ycombinator.com", "categorie": 3, "url_feed": "http://news.ycombinator.com/rss", "author": ["test"]}}, {"pk": 4, "model": "feeds.feed", "fields": {"publish_date": "2012-07-02T19:03:30.257", "title": "www.reddit.com", "categorie": 3, "url_feed": "http://www.reddit.com/.rss", "author": ["test"]}}, {"pk": 5, "model": "feeds.feed", "fields": {"publish_date": "2012-07-02T19:03:30.314", "title": "seenthis.net", "categorie": 3, "url_feed": "http://seenthis.net/people/magik/follow/feed", "author": ["test"]}}, {"pk": 6, "model": "feeds.feed", "fields": {"publish_date": "2012-07-02T19:03:30.360", "title": "feeds.feedburner.com", "categorie": 3, "url_feed": "http://feeds.feedburner.com/internetactu/bcmJ", "author": ["test"]}}, {"pk": 7, "model": "feeds.feed", "fields": {"publish_date": "2012-07-02T19:03:30.419", "title": "larlet.fr", "categorie": 3, "url_feed": "https://larlet.fr/david/log/", "author": ["test"]}}, {"pk": 8, "model": "feeds.feed", "fields": {"publish_date": "2012-07-02T19:03:30.531", "title": "zythom.blogspot.com", "categorie": 4, "url_feed": "http://zythom.blogspot.com/feeds/posts/default", "author": ["test"]}}, {"pk": 9, "model": "feeds.feed", "fields": {"publish_date": "2012-07-02T19:03:30.602", "title": "embruns.net", "categorie": 4, "url_feed": "http://embruns.net/atom.xml", "author": ["test"]}}, {"pk": 10, "model": "feeds.feed", "fields": {"publish_date": "2012-07-02T19:03:30.824", "title": "mathieu.agopian.info", "categorie": 7, "url_feed": "http://mathieu.agopian.info/blog/feeds/all.atom.xml", "author": ["test"]}}, {"pk": 11, "model": "feeds.feed", "fields": {"publish_date": "2012-07-02T19:03:30.976", "title": "openweb.eu.org", "categorie": 8, "url_feed": "http://openweb.eu.org/spip.php?page=backend", "author": ["test"]}}, {"pk": 13, "model": "feeds.feed", "fields": {"publish_date": "2012-07-02T19:03:31.159", "title": "www.blogger.com", "categorie": 9, "url_feed": "http://www.blogger.com/feeds/9055497882207462476/posts/default", "author": ["test"]}}, {"pk": 14, "model": "feeds.feed", "fields": {"publish_date": "2012-07-03T19:03:03", "title": "donneesouvertes.info", "categorie": 4, "url_feed": "http://donneesouvertes.info/feed/", "author": ["test"]}}]

minirss/settings.py

 PROJECT_ROOT = os.path.dirname(os.path.realpath(__file__))
 PROJECT_NAME = os.path.basename(PROJECT_ROOT)
 STATIC_ABSPATH = os.path.abspath('static')
+FIXTURE_DIRS = (os.path.join(PROJECT_ROOT, 'fixtures'),)
 
 # Absolute filesystem path to the directory that will hold user-uploaded files.
 # Example: "/home/media/media.lawrence.com/media/"
     'django.contrib.admin',
     'categories',
     'feeds',
+    'django_nose',
 )
 
+TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
+
+# Authorized filestype
 TASK_UPLOAD_FILE_TYPES = ['xml', 'opml']
 TASK_UPLOAD_FILE_MAX_SIZE = "5242880"
 

minirss/tests.py

-
-
-# -*- coding: utf-8 -*-
-
-"""
-This file demonstrates writing tests using the unittest module. These will pass
-when you run "manage.py test".
-
-Replace this with more appropriate tests for your application.
-"""
-
-from django.test import TestCase, Client
-from django.utils import unittest
-from datetime import datetime, timedelta
-from django.contrib.auth.models import User
-from categories.models import Categorie
-from feeds.models import Feed
-
-
-class BasicTest(unittest.TestCase):
-    def setUp(self):
-        self.client = Client()
-
-    def test_home(self):
-        response = self.client.get('/')
-        self.assertEqual(response.status_code, 200)
-
-    def test_privacy(self):
-        response = self.client.get('/privacy/')
-        self.assertEqual(response.status_code, 200)
-
-
-class AllTestCase(TestCase):
-    def setUp(self):
-        # import pytz
-        # paris = datetime.now()
-        # paris_tz = pytz.timezone("Europe/Paris")
-        # paris_date = paris_tz.localize(paris)
-        self.user = User.objects.create_user(
-            username=u'admin',
-            email=u'admin@admin.com',
-            password=u'1234567890')
-        self.categorie = Categorie.objects.create(
-            title=u'First categorie',
-            content=u'Content lipsum hein!',
-            author=self.user,
-            published=True)
-        self.feed = Feed.objects.create(
-            categorie=self.categorie,
-            author=self.user,
-            content=u'Content lipsum hein!',
-            published=True)
-        f.close()
-
-        self.c = Client()
-
-    def test_categorie_create(self):
-        """ Categorie create! You sure?
-        """
-        self.assertEquals(self.rubrique.title, u'First categorie')
-        self.assertEquals(self.rubrique.content, u'Content lipsum hein!')
-        self.assertEquals(self.rubrique.author, self.user)
-
-    def test_categorie_details(self):
-        self.c.login(username='admin', password='1234567890')
-        response = self.client.get('/categories/%s/' % self.categorie)
-        self.assertEqual(response.status_code, 200)
-        self.assertNotEqual(response.content, '{}')
-        self.assertEqual(len(response.context['title']), 5)
-        self.assertEqual(len(response.context['publish_date']), 5)
-
-    def test_feed_create(self):
-        """ Feed created! You sure?
-        """
-        self.assertEquals(self.article.title, u'First feed')
-        self.assertEquals(self.article.content, u'Content lipsum hein!')
-        self.assertEquals(self.article.author, self.user)
-
-    def test_feeds_details(self):
-        response = self.client.get('/feeds/%s/' % self.article)
-        self.assertEqual(response.status_code, 200)
-        self.assertNotEqual(response.content, '{}')
-        self.assertEqual(len(response.context['title']), 5)
-        self.assertEqual(len(response.context['publish_date']), 5)

minirss/tests/__init__.py

+from minirss.tests.tests import *

minirss/tests/tests.py

+
+
+# -*- coding: utf-8 -*-
+
+"""
+This file demonstrates writing tests using the unittest module. These will pass
+when you run "manage.py test".
+
+Replace this with more appropriate tests for your application.
+"""
+
+from django_nose.testcases import FastFixtureTestCase
+from django.contrib.auth.models import User
+from django.conf import settings
+from categories.models import Categorie
+from feeds.models import Feed
+
+urls = 'urls'
+
+
+class BasicModelsTest(FastFixtureTestCase):
+    """ Authentification test
+    """
+    backend = 'django.contrib.auth.tests.auth_backends'
+
+    def setUp(self):
+        self.curr_auth = settings.AUTHENTICATION_BACKENDS
+        settings.AUTHENTICATION_BACKENDS = (self.backend,)
+        self.user1 = User.objects.create_user(
+            'test',
+            'test@example.com',
+            'test')
+        self.user1.is_active = True
+        self.user1.save()
+
+    def tearDown(self):
+        settings.AUTHENTICATION_BACKENDS = self.curr_auth
+
+    def true_user(self):
+        login = self.client.login(username='test', password='test')
+        self.failUnlessEqual(login, True)
+        self.assertTrue(login)
+        self.client.logout()
+
+    def false_user(self):
+        login = self.client.login(username='tes', password='test')
+        self.failUnlessEqual(login, False)
+        self.assertFalse(login)
+        self.client.logout()
+
+    def login(self, password='test'):
+        response = self.client.post('/admin/', {
+            'username': 'test',
+            'password': password,
+        })
+        self.assertEqual(response.status_code, 302)
+        self.assertTrue(response['Location'].endswith(
+            settings.LOGIN_REDIRECT_URL))
+        self.assertTrue(SESSION_KEY in self.client.session)
+
+    def assertContainsEscaped(self, response, text, **kwargs):
+        return self.assertContains(
+            response, escape(force_unicode(text)), **kwargs)
+
+
+class BasicViewsTest(FastFixtureTestCase):
+    """ Basic views test
+    """
+    def test_home(self):
+        # Simple test home page
+        response = self.client.get('/')
+        self.assertEqual(response.status_code, 200)
+
+    def test_privacy(self):
+        # Simple test privacy page
+        response = self.client.get('/privacy/')
+        self.assertEqual(response.status_code, 200)
 urlpatterns = patterns(
     '',
     url(r'^$', 'minirss.views.index'),
-    url(r'^(?P<page_number>\d+)/$', 'minirss.views.index', name='recent-entries'),
+    url(r'^(?P<page_number>\d+)/$',
+        'minirss.views.index', name='recent-entries'),
     url(r'^categories/', include('categories.urls')),
     url(r'^feeds/', include('feeds.urls')),
     url(r'^clean/$', 'minirss.views.clean', name='clean'),
 def _lookup_template(name):
     return 'minirss/%s.html' % name
 
+
 def index(request):
     """ list feeds
     """
-    from feeds.models import Feed
     form_import = Feed.FeedForm()
     entries = queryset_iterator(Categorie.objects.order_by('publish_date'))
     list_feeds = Feed.objects.order_by('publish_date')
 django
 opml
 pep8
+coverage
+django-nose
 
 # various packages that may be usefull
 #gunicorn