# Path: native_tags/registry.py
# def register(self, bucket, name_or_func, func=None):
#     """
#     Add a function to the registry by name
#     """
#     assert bucket in self, 'Bucket %s is unknown' % bucket
#     if func is None and hasattr(name_or_func, '__name__'):
#         name = name_or_func.__name__
#         func = name_or_func
#     elif func:
#         name = name_or_func
#     if name in self[bucket]:
#         raise AlreadyRegistered('The function %s is already registered' % name)
# 
#     self[bucket][name] = func
# 
# class AlreadyRegistered(Exception):
#     "The function you are trying to register is already in the registry"
#     pass
# 
# Path: native_tags/nodes.py
# def get_cache_key(bucket, name, args, kwargs):
#     """
#     Gets a unique SHA1 cache key for any call to a native tag.
#     Use args and kwargs in hash so that the same arguments use the same key
#     """
#     u = ''.join(map(str, (bucket, name, args, kwargs)))
#     return 'native_tags.%s' % sha_constructor(u).hexdigest()


import datetime
        import math
        import hashlib
        import pygments
        import GChartWrapper
        import feedparser
        import markdown
from django.contrib.auth.models import User
from django.template import Template, Context, TemplateSyntaxError
from django.test import TestCase
from django.core.serializers import deserialize
from django.core.cache import cache
from native_tags.registry import register, AlreadyRegistered
from native_tags.nodes import get_cache_key
        from native_tags.nodes import split
        self.assertEqual(render('{{ foo|md5 }}{% md5 foo %}', self.hash), md5*2)
    
    def test_greater(self):
        t = '{% if_greater 2 1 %}yup{% endif_greater %}'
        self.assertEqual(render(t), 'yup')
    
    def test_render_block(self):
        t = '{% render_block as myvar %}hello {{ place }}{% endrender_block %}{{ myvar }}'
        self.assertEqual(render(t, {'place':'world'}), 'hello world')
    
    def test_get_latest_object(self):
        t = '{% get_latest_object auth.user date_joined %}'
        self.assertEqual(render(t), 'tester')
    
    def test_get_latest_objects(self):
        t = '{% get_latest_objects auth.user 10 %}'
        self.assertEqual(render(t), '[<User: tester>]')
    
    def test_get_random_object(self):
        t = '{% get_random_object auth.user %}'
        self.assertEqual(render(t), 'tester')
    
    def test_get_random_objects(self):
        t = '{% get_random_objects auth.user 10 %}'
        self.assertEqual(render(t), '[<User: tester>]')
    
    def test_retrieve_object(self):
        t = '{% retrieve_object auth.user username=tester %}'
        self.assertEqual(render(t), 'tester')
    

# Path: native_tags/registry.py
# def register(self, bucket, name_or_func, func=None):
#     """
#     Add a function to the registry by name
#     """
#     assert bucket in self, 'Bucket %s is unknown' % bucket
#     if func is None and hasattr(name_or_func, '__name__'):
#         name = name_or_func.__name__
#         func = name_or_func
#     elif func:
#         name = name_or_func
#     if name in self[bucket]:
#         raise AlreadyRegistered('The function %s is already registered' % name)
# 
#     self[bucket][name] = func
# 
# class AlreadyRegistered(Exception):
#     "The function you are trying to register is already in the registry"
#     pass
# 
# Path: native_tags/nodes.py
# def get_cache_key(bucket, name, args, kwargs):
#     """
#     Gets a unique SHA1 cache key for any call to a native tag.
#     Use args and kwargs in hash so that the same arguments use the same key
#     """
#     u = ''.join(map(str, (bucket, name, args, kwargs)))
#     return 'native_tags.%s' % sha_constructor(u).hexdigest()


# Path: example_project/app/tests.py
import datetime
        import math
        import hashlib
        import pygments
        import GChartWrapper
        import feedparser
        import markdown
from django.contrib.auth.models import User
from django.template import Template, Context, TemplateSyntaxError
from django.test import TestCase
from django.core.serializers import deserialize
from django.core.cache import cache
from native_tags.registry import register, AlreadyRegistered
from native_tags.nodes import get_cache_key
        from native_tags.nodes import split

        self.assertEqual(render('{{ foo|md5 }}{% md5 foo %}', self.hash), md5*2)
    
    def test_greater(self):
        t = '{% if_greater 2 1 %}yup{% endif_greater %}'
        self.assertEqual(render(t), 'yup')
    
    def test_render_block(self):
        t = '{% render_block as myvar %}hello {{ place }}{% endrender_block %}{{ myvar }}'
        self.assertEqual(render(t, {'place':'world'}), 'hello world')
    
    def test_get_latest_object(self):
        t = '{% get_latest_object auth.user date_joined %}'
        self.assertEqual(render(t), 'tester')
    
    def test_get_latest_objects(self):
        t = '{% get_latest_objects auth.user 10 %}'
        self.assertEqual(render(t), '[<User: tester>]')
    
    def test_get_random_object(self):
        t = '{% get_random_object auth.user %}'
        self.assertEqual(render(t), 'tester')
    
    def test_get_random_objects(self):
        t = '{% get_random_objects auth.user 10 %}'
        self.assertEqual(render(t), '[<User: tester>]')
    
    def test_retrieve_object(self):
        t = '{% retrieve_object auth.user username=tester %}'
        self.assertEqual(render(t), 'tester')
    

    def test_matches(self):