File: test_instrumented_list.py

package info (click to toggle)
python-sqlalchemy-utils 0.30.12-2~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 1,056 kB
  • sloc: python: 10,350; makefile: 160
file content (14 lines) | stat: -rw-r--r-- 528 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from tests import TestCase


class TestInstrumentedList(TestCase):
    def test_any_returns_true_if_member_has_attr_defined(self):
        category = self.Category()
        category.articles.append(self.Article())
        category.articles.append(self.Article(name=u'some name'))
        assert category.articles.any('name')

    def test_any_returns_false_if_no_member_has_attr_defined(self):
        category = self.Category()
        category.articles.append(self.Article())
        assert not category.articles.any('name')