Migrate from basictag to simple_tag

Review Request #7910 — Created Jan. 25, 2016 and submitted

Information

Djblets
release-0.10.x

Reviewers

Now that @basictag is becoming deprecated in Djblets 0.10, we are
migrating all usage of @basictag to Django's @Library.simple_tag
decorator. To ensure that everything works correcty, unit tests have
been added to test all tags that previously used @basictag to
ensure that they will continue to render correctly.

Several testing utilities have been added in this patch to facilitate
this migration. First off is the MemoryTemplateLoader, which loads
template sources from an in-memory string. This is to be used in
conjunction with the context managers provided by
djblets.template.loaders.util:

  • add_template_loader, which temporarily adds a template source
    loader; and
  • replace_template_loaders, which temporarily replaces all the
    template source loaders.

Ran unit tests.

Description From Last Updated

Col: 9 E303 too many blank lines (2)

reviewbotreviewbot

Col: 1 W391 blank line at end of file

reviewbotreviewbot

Col: 1 W391 blank line at end of file

reviewbotreviewbot

There's an extra line here.

daviddavid

Col: 1 E302 expected 2 blank lines, found 1

reviewbotreviewbot
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        djblets/util/templatetags/tests.py
        djblets/extensions/templatetags/djblets_extensions.py
        djblets/template/loaders/util.py
        djblets/gravatars/templatetags/tests.py
        djblets/extensions/templatetags/tests.py
        djblets/util/templatetags/djblets_utils.py
        djblets/template/loaders/memory.py
        djblets/util/templatetags/djblets_email.py
        djblets/gravatars/templatetags/gravatars.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        djblets/util/templatetags/tests.py
        djblets/extensions/templatetags/djblets_extensions.py
        djblets/template/loaders/util.py
        djblets/gravatars/templatetags/tests.py
        djblets/extensions/templatetags/tests.py
        djblets/util/templatetags/djblets_utils.py
        djblets/template/loaders/memory.py
        djblets/util/templatetags/djblets_email.py
        djblets/gravatars/templatetags/gravatars.py
    
    
  2. Show all issues
    Col: 9
     E303 too many blank lines (2)
    
  3. djblets/util/templatetags/tests.py (Diff revision 1)
     
     
    Show all issues
    Col: 1
     W391 blank line at end of file
    
  4. 
      
brennie
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        djblets/util/templatetags/tests.py
        djblets/extensions/templatetags/djblets_extensions.py
        djblets/template/loaders/util.py
        djblets/gravatars/templatetags/tests.py
        djblets/extensions/templatetags/tests.py
        djblets/util/templatetags/djblets_utils.py
        djblets/template/loaders/memory.py
        djblets/util/templatetags/djblets_email.py
        djblets/gravatars/templatetags/gravatars.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        djblets/util/templatetags/tests.py
        djblets/extensions/templatetags/djblets_extensions.py
        djblets/template/loaders/util.py
        djblets/gravatars/templatetags/tests.py
        djblets/extensions/templatetags/tests.py
        djblets/util/templatetags/djblets_utils.py
        djblets/template/loaders/memory.py
        djblets/util/templatetags/djblets_email.py
        djblets/gravatars/templatetags/gravatars.py
    
    
  2. djblets/util/templatetags/tests.py (Diff revision 2)
     
     
    Show all issues
    Col: 1
     W391 blank line at end of file
    
  3. 
      
brennie
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        djblets/util/templatetags/tests.py
        djblets/extensions/templatetags/djblets_extensions.py
        djblets/template/loaders/util.py
        djblets/gravatars/templatetags/tests.py
        djblets/extensions/templatetags/tests.py
        djblets/util/templatetags/djblets_utils.py
        djblets/template/loaders/memory.py
        djblets/util/templatetags/djblets_email.py
        djblets/gravatars/templatetags/gravatars.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        djblets/util/templatetags/tests.py
        djblets/extensions/templatetags/djblets_extensions.py
        djblets/template/loaders/util.py
        djblets/gravatars/templatetags/tests.py
        djblets/extensions/templatetags/tests.py
        djblets/util/templatetags/djblets_utils.py
        djblets/template/loaders/memory.py
        djblets/util/templatetags/djblets_email.py
        djblets/gravatars/templatetags/gravatars.py
    
    
  2. 
      
david
  1. Just a question on use of Mock: didn't Christian want to get rid of these?

    1. Indeed! I've found a way to not use mock here.

  2. djblets/template/loaders/memory.py (Diff revision 3)
     
     
    Show all issues

    There's an extra line here.

  3. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/util/templatetags/tests.py
        djblets/extensions/templatetags/djblets_extensions.py
        djblets/template/loaders/util.py
        djblets/gravatars/templatetags/tests.py
        djblets/extensions/templatetags/tests.py
        djblets/util/templatetags/djblets_utils.py
        djblets/template/loaders/memory.py
        djblets/util/templatetags/djblets_email.py
        djblets/gravatars/templatetags/gravatars.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/util/templatetags/tests.py
        djblets/extensions/templatetags/djblets_extensions.py
        djblets/template/loaders/util.py
        djblets/gravatars/templatetags/tests.py
        djblets/extensions/templatetags/tests.py
        djblets/util/templatetags/djblets_utils.py
        djblets/template/loaders/memory.py
        djblets/util/templatetags/djblets_email.py
        djblets/gravatars/templatetags/gravatars.py
    
    
  2. Show all issues
    Col: 1
     E302 expected 2 blank lines, found 1
    
  3. 
      
brennie
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        djblets/util/templatetags/tests.py
        djblets/extensions/templatetags/djblets_extensions.py
        djblets/template/loaders/util.py
        djblets/gravatars/templatetags/tests.py
        djblets/extensions/templatetags/tests.py
        djblets/util/templatetags/djblets_utils.py
        djblets/template/loaders/memory.py
        djblets/util/templatetags/djblets_email.py
        djblets/gravatars/templatetags/gravatars.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        djblets/util/templatetags/tests.py
        djblets/extensions/templatetags/djblets_extensions.py
        djblets/template/loaders/util.py
        djblets/gravatars/templatetags/tests.py
        djblets/extensions/templatetags/tests.py
        djblets/util/templatetags/djblets_utils.py
        djblets/template/loaders/memory.py
        djblets/util/templatetags/djblets_email.py
        djblets/gravatars/templatetags/gravatars.py
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
brennie
Review request changed
Status:
Completed
Change Summary:
Pushed to release-0.10.x (79d41e4)