File: test_comparator.py

package info (click to toggle)
sqlalchemy-i18n 1.1.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 396 kB
  • sloc: python: 2,164; makefile: 157
file content (24 lines) | stat: -rw-r--r-- 586 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# -*- coding: utf-8 -*-

from pytest import raises

from sqlalchemy_i18n import UnknownLocaleError
from tests import ClassicTestCase, DeclarativeTestCase


class Suite(object):
    def test_attribute_accessor_for_unknown_locale(self):
        with raises(UnknownLocaleError):
            assert self.Article.translations.some_unknown_locale

    def test_attribute_accessors(self):
        assert self.Article.translations.en
        assert self.Article.translations.fi


class TestDeclarative(Suite, DeclarativeTestCase):
    pass


class TestClassic(Suite, ClassicTestCase):
    pass