test_section.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # This program is free software; you can redistribute it and/or modify
  2. # it under the terms of the GNU General Public License as published by
  3. # the Free Software Foundation; either version 2 of the License, or
  4. # (at your option) any later version.
  5. # This program is distributed in the hope that it will be useful,
  6. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  7. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8. # GNU General Public License for more details.
  9. # You should have received a copy of the GNU General Public License
  10. # along with this program; if not, write to the Free Software
  11. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  12. ################################################################################
  13. import pytest
  14. from .section import Section
  15. def test_Section(session):
  16. obj = Section('section')
  17. session.add(obj)
  18. session.flush()
  19. get = Section.get(1, session)
  20. assert get
  21. assert get.section == 'section'
  22. def test_Section___eq__():
  23. obj = Section('section')
  24. assert obj == 'section'
  25. assert 'section' == obj
  26. def test_Section___ne__():
  27. obj = Section('section')
  28. assert obj != 'zzzz'
  29. assert 'zzzz' != obj