Ejemplo n.º 1
0
    def test_returns_value_when_resolved_path_equals_current_path(self):
        return_value = ' active'
        returned_value = current({'request': self.request}, self.url_name)
        self.assertEquals(return_value, returned_value)

        return_value = 'test'
        returned_value = current({'request': self.request}, self.url_name,
                                 return_value)
        self.assertEquals(return_value, returned_value)
Ejemplo n.º 2
0
    def test_returns_value_when_resolved_path_equals_current_path(self):
        return_value = ' active'
        returned_value = current({'request': self.request}, self.url_name)
        self.assertEquals(return_value, returned_value)

        return_value = 'test'
        returned_value = current({'request': self.request},
                                 self.url_name, return_value)
        self.assertEquals(return_value, returned_value)
Ejemplo n.º 3
0
 def test_returns_empty_string_when_current_path_is_not_resolved(self):
     return_value = ''
     request = mock.Mock
     request.path = '/invalid-!@#-path'
     returned_value = current({'request': request}, 'test')
     self.assertEquals(return_value, returned_value)
Ejemplo n.º 4
0
 def test_returns_empty_string_when_resolved_path_not_equals_current_path(
         self):
     return_value = ''
     returned_value = current({'request': self.request}, 'not_login')
     self.assertEquals(return_value, returned_value)
Ejemplo n.º 5
0
 def test_returns_empty_string_when_current_path_is_not_resolved(self):
     return_value = ''
     request = mock.Mock
     request.path = '/invalid-!@#-path'
     returned_value = current({'request': request}, 'test')
     self.assertEquals(return_value, returned_value)
Ejemplo n.º 6
0
 def test_returns_empty_string_when_resolved_path_not_equals_current_path(self):
     return_value = ''
     returned_value = current({'request': self.request}, 'not_login')
     self.assertEquals(return_value, returned_value)