Coder Social home page Coder Social logo

Comments (2)

wilian746 avatar wilian746 commented on July 30, 2024

Example how i use

    def test_check_length_is_two(self):
        self.session_unified = UnifiedAlchemyMagicMock()

        self.session_unified.add(PermissionModel(
            id="7de42c1b-7321-4042-84af-d9be3b3562f3",
            description="permission of xablau"
        ))

        self.session_unified.add(UserModel(
            id="19dc9999-9331-4212-9199-e8f2acdcbb3f",
            active=True,
            name="xablau1",
            email="[email protected]",
            password="@Xablau1",
            permission_id="7de42c1b-7321-4042-84af-d9be3b3562f3"
        ))

        self.session_unified.add(UserModel(
            id="29dc9999-9331-4212-9199-e8f2acdcbb3f",
            active=True,
            name="xablau2",
            email="[email protected]",
            password="@Xablau2",
            permission_id="7de42c1b-7321-4042-84af-d9be3b3562f3"
        ))

        self.session_unified.add(UserModel(
            id="39dc9999-9331-4212-9199-e8f2acdcbb3f",
            active=True,
            name="xablau3",
            email="[email protected]",
            password="@Xablau3",
            permission_id="7de42c1b-7321-4042-84af-d9be3b3562f3"
        ))

        data = self.session_unified.query(UserModel).paginate(page=1, per_page=2, max_per_page=100)

       # Broken because return an Empty List
        self.assertEqual(len(data), 2)

from alchemy-mock.

shosca avatar shosca commented on July 30, 2024

@miki725, there's no paginate method on sqlalchemy's query, its only available on flask-sqlalchemy's query implementation.

from alchemy-mock.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.