def test_attendee_count__home_housing(self): """Attendee count should be present & accurate; housing data should.""" event = EventFactory(collect_housing_data=True) order = OrderFactory(event=event) transaction = TransactionFactory(event=event, order=order) item = ItemFactory(event=event) item_option = ItemOptionFactory(price=100, item=item) order.add_to_cart(item_option) order.add_to_cart(item_option) order.mark_cart_paid(transaction) AttendeeFactory( order=order, bought_items=order.bought_items.all(), housing_status=Attendee.HOME, ) view = EventSummaryView() view.request = self.factory.get('/') view.request.user = AnonymousUser() view.event = event context_data = view.get_context_data() self.assertEqual(context_data['attendee_count'], 1) self.assertEqual(context_data['attendee_requesting_count'], 0) self.assertEqual(context_data['attendee_arranged_count'], 0) self.assertEqual(context_data['attendee_home_count'], 1)
url(r'^transfer/$', TransferView.as_view(), name="brambling_event_order_transfer"), ] event_urlpatterns = [ url(r'^$', RedirectView.as_view(pattern_name="brambling_event_order_summary", permanent=False), name="brambling_event_root"), url(r'^order/', include(order_urlpatterns)), url(r'^order/(?P<code>[a-zA-Z0-9]{8})/', OrderCodeRedirectView.as_view(), name='brambling_order_code_redirect'), url(r'^summary/$', EventSummaryView.as_view(), name="brambling_event_summary"), url(r'^basic/$', EventBasicSettingsView.as_view(), name="brambling_event_basic"), url(r'^design/$', EventDesignView.as_view(), name="brambling_event_design"), url(r'^permissions/$', EventPermissionsView.as_view(), name="brambling_event_permissions"), url(r'^registration/$', EventRegistrationView.as_view(), name="brambling_event_registration"), url(r'^remove_member/(?P<pk>\d+)$', EventRemoveMemberView.as_view(), name="brambling_event_remove_member"),
TransferView.as_view(), name="brambling_event_order_transfer"), ] event_urlpatterns = [ url(r'^$', RedirectView.as_view(pattern_name="brambling_event_order_summary", permanent=False), name="brambling_event_root"), url(r'^order/', include(order_urlpatterns)), url(r'^order/(?P<code>[a-zA-Z0-9]{8})/', OrderCodeRedirectView.as_view(), name='brambling_order_code_redirect'), url(r'^summary/$', EventSummaryView.as_view(), name="brambling_event_summary"), url(r'^basic/$', EventBasicSettingsView.as_view(), name="brambling_event_basic"), url(r'^design/$', EventDesignView.as_view(), name="brambling_event_design"), url(r'^permissions/$', EventPermissionsView.as_view(), name="brambling_event_permissions"), url(r'^registration/$', EventRegistrationView.as_view(), name="brambling_event_registration"), url(r'^remove_member/(?P<pk>\d+)$', EventRemoveMemberView.as_view(),