Commit fbc2ba4b authored by okhin's avatar okhin

100% coverage of campaign

parent b6ca30e7
......@@ -25,10 +25,7 @@ class CampaignAdmin(admin.ModelAdmin):
return super(CampaignAdmin, self).formfield_for_foreignkey(db_field,
request,
**kwargs)
class CampaignContactAdmin(admin.ModelAdmin):
def get_queryset(self, request):
qs = super(CampaignContactAdmin, self).get_queryset(request)
if request.user.is_superuser:
......@@ -38,7 +35,6 @@ class CampaignContactAdmin(admin.ModelAdmin):
class ArgumentaryAdmin(admin.ModelAdmin):
def get_queryset(self, request):
qs = super(ArgumentaryAdmin, self).get_queryset(request)
if request.user.is_superuser:
......@@ -54,8 +50,6 @@ class ArgumentaryAdmin(admin.ModelAdmin):
return super(ArgumentaryAdmin, self).formfield_for_foreignkey(db_field,
request,
**kwargs)
admin.site.register(Campaign, CampaignAdmin)
admin.site.register(CampaignContact, CampaignContactAdmin)
admin.site.register(Argumentary, ArgumentaryAdmin)
from django.conf import settings
from django.test import TestCase
from django.contrib.auth.models import User
from picampaign.campaign.models import Campaign, CampaignContact, Argumentary
from picampaign.contact.models import Contact
from picampaign.campaign.admin import CampaignAdmin
class ArgumentaryMethodTests(TestCase):
def test_str(self):
......
......@@ -6,4 +6,3 @@ class ContactMethodsTest(TestCase):
def test_full_name(self):
contact = Contact(first_name='Victor', last_name='Hugo')
self.assertEqual(contact.full_name(), 'Victor Hugo')
#!/bin/bash
${VIRTUAL_ENV}/bin/coverage run --source='.' manage.py test --parallel
${VIRTUAL_ENV}/bin/coverage report --omit="${VIRTUAL_ENV}/*",'*__init__.py'
${VIRTUAL_ENV}/bin/coverage report -m --skip-covered --omit="${VIRTUAL_ENV}/*","*__init__.py"
${VIRTUAL_ENV}/bin/coverage report -m --skip-covered --omit="${VIRTUAL_ENV}/*",'*__init__.py',"*/test_*.py"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment