This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# updated models.py | |
class User(models.Model): | |
username = models.CharField(max_length=255) | |
first_name = models.CharField(max_length=100) | |
last_name = models.CharField(max_length=100) | |
status = models.IntegerField(choices=STATUS_CHOICES, default=0) | |
is_active = models.BooleanField() | |
# modified m2m to have related_name | |
favorite_books = models.ManyToManyField('Book', related_name='likers') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import operator | |
from django.db.models import Q | |
from django_filters import CharFilter | |
class MultiFieldFilter(CharFilter): | |
""" | |
This filter preforms an OR query on the defined fields from a | |
single entered value. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Allow the metal piece to run in isolation | |
require( File.dirname(__FILE__) + "/../../config/environment" ) unless defined?(Rails) | |
class PassengerRestarter | |
@restart_url = "/restart" | |
@default_target = "/" | |
@restart_message = "Restarted." | |
@set_flash = true | |
def self.call(env) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For mocha integration, add this file into features/support folder | |
require "mocha" | |
World { |world| world.extend Mocha::Standalone } | |
Before do | |
mocha_setup | |
end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Users want to use cucumber, so tests are necessary to verify | |
it is all working as expected | |
Feature: Using the Console Formatter | |
In order to verify this error | |
I want to run this feature using the progress format | |
So that it can be fixed | |
Scenario: A normal feature | |
Given I have a pending step |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## in my env.rb (only part of it) | |
require 'webrat' | |
Webrat.configure do |config| | |
config.mode = :rails | |
config.open_error_files = false | |
end | |
class Webrat::Session |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## NOTE | |
the error line indicates the second commented-out And line below, not the first | |
## account_activation.feature | |
Visitors may create an account, but for those who are not already in the | |
system an someone must activate the account for them before it can be used. | |
Feature: Activating an account | |
As a registered, but not yet activated, user |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## NOTE | |
The error refers to the first line of the second multi-line pre-scenario comments | |
## sessions.feature file | |
Users want to know that nobody can masquerade as them. We want to extend trust | |
only to visitors who present the appropriate credentials. Everyone wants this | |
identity verification to be as secure and convenient as possible. | |
Feature: Logging in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[fss] | |
recipe = iw.recipe.fss | |
# zeoclient1 and zeoclient2 are the names of you buildout parts for your zeo clients | |
# you just need a line for each zeo client you have in your buildout | |
zope-instances = | |
${zeoclient1:location} | |
${zeoclient2:location} | |
storages = | |
global / directory ${buildout:directory}/var/fss/storage ${buildout:directory}/var/fss/backup |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SUPER DARING APP TEMPLATE 1.0 | |
# By Peter Cooper | |
# Link to local copy of edge rails | |
inside('vendor') { run 'ln -s ~/dev/rails/rails rails' } | |
# Delete unnecessary files | |
run "rm README" | |
run "rm public/index.html" | |
run "rm public/favicon.ico" |
NewerOlder