#NEWLINE# def test_page_placeholder_metadata( self ) : #NEWLINE# #INDENT# '\n        The ``page_placeholder`` tag should expose metadata, which ``fluent_contents.analyzer`` can read.\n        ' #NEWLINE# template = Template ( '{% load fluent_contents_tags %}{% page_placeholder page "slot1" title="SlotTest1" role="s" %}' ) #NEWLINE# raw_placeholders = get_node_instances ( template , PagePlaceholderNode ) #NEWLINE# self . assertEqual ( len ( raw_placeholders ) , 1 ) #NEWLINE# self . assertEqual ( raw_placeholders [ 0 ] . get_slot ( ) , 'slot1' ) #NEWLINE# self . assertEqual ( raw_placeholders [ 0 ] . get_title ( ) , 'SlotTest1' ) #NEWLINE# self . assertEqual ( raw_placeholders [ 0 ] . get_role ( ) , 's' ) #NEWLINE# data = get_template_placeholder_data ( template ) #NEWLINE# self . assertEqual ( len ( data ) , 1 ) #NEWLINE# self . assertEqual ( self [ 0 ] . slot , 'slot1' ) #NEWLINE# self . assertEqual ( data [ 0 ] . title , 'SlotTest1' ) #NEWLINE# self . assertEqual ( data [ 0 ] . role , 's' ) #NEWLINE# template = Template ( '{% load fluent_contents_tags %}{% page_placeholder page "slot_test2" %}' ) #NEWLINE# raw_placeholders = get_node_instances ( template , PagePlaceholderNode ) #NEWLINE# self . assertEqual ( len ( raw_placeholders ) , 1 ) #NEWLINE# self . assertEqual ( raw_placeholders [ 0 ] . get_slot ( ) , 'slot_test2' ) #NEWLINE# self . assertEqual ( raw_placeholders [ 0 ] . get_title ( ) , 'Slot Test2' ) #NEWLINE# self . assertEqual ( raw_placeholders [ 0 ] . get_role ( ) , None ) #NEWLINE# data = get_template_placeholder_data ( template ) #NEWLINE# self . assertEqual ( len ( data ) , 1 ) #NEWLINE# self . assertEqual ( data [ 0 ] . slot , 'slot_test2' ) #NEWLINE# self . assertEqual ( data [ 0 ] . title , 'Slot Test2' ) #NEWLINE# self . assertEqual ( data [ 0 ] . role , 'm' )