예제 #1
0
파일: views_lib.py 프로젝트: kxing/Geddit
def base_params(request):
    return { \
        'categories': Category.get_all_categories(), \
        'SITE_ROOT': SITE_ROOT, \
        'user': get_current_user(request), \
        'message': request.GET.get('message', None), \
    }
예제 #2
0
파일: tests.py 프로젝트: kxing/Geddit
    def test_categories(self):
        '''
        Tests to make sure that categories can be queried
        and that the attributes are correct.
        '''
        # find the category and check it
        c = Category.get_category(self.CATEGORY_NAME)
        self.assertEqual(c, self.category)
        self.assertEqual(c.name, self.CATEGORY_NAME)

        # repeat for category 2
        c2 = Category.get_category(self.CATEGORY2_NAME)
        self.assertEqual(c2, self.category2)
        self.assertEqual(c2.name, self.CATEGORY2_NAME)

        # test to make sure that the list of all categories is sorted
        all_categories = Category.get_all_categories()
        self.assertEqual(all_categories[0], self.category2)
        self.assertEqual(all_categories[1], self.category) 
예제 #3
0
파일: views_lib.py 프로젝트: sarine/Geddit
def base_params(request):
    return { \
        'categories': Category.get_all_categories(), \
        'SITE_ROOT': SITE_ROOT, \
        'user': get_current_user(request), \
    }