Example #1
0
    def test_should_always_return_first_event_in_database(self):
        event2 = Event.objects.create(
            name='foo',
            description='bar',
        )

        response = AboutView.as_view()(self.request)
        self.assertIn(self.event, response.context_data().values())

        event2.delete()
Example #2
0
    def test_should_always_return_first_event_in_database(self):
        event2 = Event.objects.create(
            name='foo',
            description='bar',
        )

        response = AboutView.as_view()(self.request)
        self.assertIn(self.event, response.context_data().values())

        event2.delete()
Example #3
0
from django.conf.urls.defaults import patterns, include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin

from mittun.views import IndexView, AboutView

admin.autodiscover()


urlpatterns = patterns(
    "",
    url(r"^$", IndexView.as_view()),
    url(r"^index/?$", IndexView.as_view(), name="index"),
    url(r"^about/?$", AboutView.as_view(), name="about"),
    url(r"^admin/", include(admin.site.urls)),
    url(r"^bootstrap/?$", include("events.urls")),
)

urlpatterns += staticfiles_urlpatterns()
Example #4
0
 def text_context_object_must_have_an_instance_of_event_model(self):
     response = AboutView.as_view()(self.request)
     self.assertIsInstance(response.context_data['event'], Event)
Example #5
0
 def test_context_object_must_be_called_event(self):
     response = AboutView.as_view()(self.request)
     self.assertIn('event', response.context_data().keys())
Example #6
0
 def test_details_view_should_use_about_template(self):
     response = AboutView.as_view()(self.request)
     self.assertIn('about.html', response.template_name)
Example #7
0
 def test_should_request_the_details_view_and_get_an_200_status_code(self):
     response = AboutView.as_view()(self.request)
     self.assertEqual(response.status_code, 200)
Example #8
0
 def text_context_object_must_have_an_instance_of_event_model(self):
     response = AboutView.as_view()(self.request)
     self.assertIsInstance(response.context_data['event'], Event)
Example #9
0
 def test_context_object_must_be_called_event(self):
     response = AboutView.as_view()(self.request)
     self.assertIn('event', response.context_data().keys())
Example #10
0
 def test_details_view_should_use_about_template(self):
     response = AboutView.as_view()(self.request)
     self.assertIn('about.html', response.template_name)
Example #11
0
 def test_should_request_the_details_view_and_get_an_200_status_code(self):
     response = AboutView.as_view()(self.request)
     self.assertEqual(response.status_code, 200)
Example #12
0
from django.conf.urls.defaults import patterns, include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin

from mittun.views import IndexView, AboutView

admin.autodiscover()

urlpatterns = patterns(
    '',
    url(r'^$', IndexView.as_view()),
    url(r'^index/?$', IndexView.as_view(), name="index"),
    url(r'^about/?$', AboutView.as_view(), name="about"),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^sponsors/?$', include('mittun.sponsors.urls')),
)

urlpatterns += staticfiles_urlpatterns()
Example #13
0
 def test_context_object_must_be_called_event(self):
     response = AboutView.as_view()(self.request, slug=self.event.slug)
     self.assertTrue('event' in response.context_data().keys())
Example #14
0
from django.conf.urls.defaults import patterns, include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.contrib import admin

from mittun.views import IndexView, AboutView

admin.autodiscover()


urlpatterns = patterns('',
    url(r'^$', IndexView.as_view()),
    url(r'^index/?$', IndexView.as_view(), name="index"),
    url(r'^about/?$', AboutView.as_view(), name="about"),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^sponsors/?$', include('mittun.sponsors.urls')),
)

urlpatterns += staticfiles_urlpatterns()