Skip to content
This repository has been archived by the owner on Apr 28, 2020. It is now read-only.

Testing environment bootstrapping #53

Merged
merged 18 commits into from
Aug 20, 2013
Merged

Testing environment bootstrapping #53

merged 18 commits into from
Aug 20, 2013

Conversation

miteshashar
Copy link
Contributor

Not sure if I am going on the correct path. Please review and give me feedback.
@kracekumar @jace

[nosetests]
match=^test
nocapture=1
cover-package=lastuser_core
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should cover all three blueprints.

from lastuser_core.models import *

def make_fixtures():
user1 = User(username=u"user1", fullname=u"User 1")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PEP8 compliance required. Indentation is four spaces. Install SublimeLinter and drop these exceptions to PEP8 in SublimeLinter.sublime-settings (Sublime Text -> Preferences -> Package Settings -> SublimeLinter -> Settings - User):

{
    "pep8_ignore":
    [
        "E501",
        "E128",
        "E123",
        "E124"
    ]
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do this. Thanks. Have been lately facing lots of issues with indentation.

org.owners.users.append(user1)
db.session.add(org)

client = Client(title=u"Test Application", org=org, user=user1, website=u"http://example.com")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clients can belong to an org or a user, not both. This operation should fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

org.owners.users.append(user1)
db.session.add(org)

client = Client(title=u"Test Application", org=org, user=user1, website=u"http://example.com")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, it doesn't fail because SQL doesn't allow one to apply this OR that constraints across fields. This has to be enforced by the model itself via column validators.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correction: SQL does have the CHECK constraint for just this purpose. We now use it extensively in Lastuser.

This was referenced Aug 20, 2013
jace added a commit that referenced this pull request Aug 20, 2013
Testing environment bootstrapping
@jace jace merged commit 7147a31 into crudapi Aug 20, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants