Beispiel #1
0
    def setUp(self):
        self.referral_a = Referral(name="A", clicks=0)
        self.referral_a.save()
        self.referral_b = Referral(name="B", clicks=0)
        self.referral_b.save()
        self.referral_c = Referral(name="C", clicks=0, active=False)
        self.referral_c.save()

        self.detail_view = ReferralDetail.as_view()
        self.list_view = ReferralList.as_view()
Beispiel #2
0
from django.conf.urls import patterns, url
from rest_framework.urlpatterns import format_suffix_patterns

from referral.views import dashboard, landing, ReferralDetail, ReferralList

urlpatterns = patterns('',

    url(r'^$', dashboard, name='dashboard'),
    url(r'^landing/$', landing, name='landing'),

    # API Urls
    url(r'^api/referrals/$', ReferralList.as_view()),
    url(r'^api/referrals/(?P<pk>[0-9]+)/$', ReferralDetail.as_view()),

)

urlpatterns = format_suffix_patterns(urlpatterns)