<s> from unittest import TestCase <EOL> from nose import tools <EOL> from django . contrib import admin <EOL> from ella . core . models import Author <EOL> from ella . articles . models import Article <EOL> from ella . positions . admin import PositionOptions <EOL> from ella . positions . models import Position <EOL> class TestPositionAdmin ( TestCase ) : <EOL> def setUp ( self ) : <EOL> super ( TestPositionAdmin , self ) . setUp ( ) <EOL> self . author = Author ( slug = '<STR_LIT>' ) <EOL> self . position_admin = PositionOptions ( model = Position , admin_site = admin . site ) <EOL> def test_result_of_show_title_for_obj_with_title_attr ( self ) : <EOL> art = Article ( title = '<STR_LIT>' ) <EOL> p = Position ( ) <EOL> p . target = art <EOL> tools . assert_equals ( u'<STR_LIT>' , self . position_admin . show_title ( p ) ) <EOL> def test_result_of_show_title_for_obj_without_title_attr ( self ) : <EOL> aut = Author ( name = '<STR_LIT>' ) <EOL> p = Position ( ) <EOL> p . target = aut <EOL> tools . assert_equals ( u'<STR_LIT>' , self . position_admin . show_title ( p ) ) <EOL> def test_result_of_show_title_for_position_without_trget ( self ) : <EOL> p = Position ( ) <EOL> tools . assert_true ( self . position_admin . show_title ( p ) . startswith ( '<STR_LIT>' ) ) </s>
