Skip to content
This repository has been archived by the owner. It is now read-only.
Browse files

create waffle flags in cache only

  • Loading branch information...
Andy McKay
Andy McKay committed Nov 17, 2012
1 parent 334d038 commit ee2610c211db636290a84bf8d15bbd4b4f2404e9
Showing with 8 additions and 5 deletions.
  1. +8 −5 apps/amo/tests/
@@ -23,6 +23,7 @@
from nose.exc import SkipTest
from import eq_, nottest
from redisutils import mock_redis, reset_redis
from waffle import cache_sample, cache_switch
from waffle.models import Flag, Sample, Switch

@@ -385,17 +386,19 @@ def make_premium(self, addon, currencies=None):
AddonPremium.objects.create(addon=addon, price=price)

def create_sample(self, name=None, **kw):
def create_sample(self, name=None, db=False, **kw):
if name is not None:
kw['name'] = name
kw.setdefault('percent', 100)
sample = Sample(**kw) if db else cache_sample(instance=sample)

def create_switch(self, name=None, **kw):
def create_switch(self, name=None, db=False, **kw):
kw.setdefault('active', True)
if name is not None:
kw['name'] = name
kw.setdefault('active', True)
switch = Switch(**kw) if db else cache_switch(instance=switch)

def create_flag(self, name=None, **kw):
if name is not None:

0 comments on commit ee2610c

Please sign in to comment.
You can’t perform that action at this time.