Skip to content

Commit

Permalink
Restore completed_overview logic fixes #541
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredlockhart committed Sep 20, 2018
1 parent cd3a6b1 commit 4e8d19f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/experimenter/experiments/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ def is_begun(self):
def is_high_risk(self):
return True in self._risk_questions

@property
def completed_overview(self):
return self.pk is not None

@property
def completed_population(self):
return (
Expand Down
8 changes: 8 additions & 0 deletions app/experimenter/experiments/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,14 @@ def test_experiment_is_begun(self):
experiment = ExperimentFactory.create_with_status(status)
self.assertTrue(experiment.is_begun)

def test_overview_is_not_complete_when_not_saved(self):
experiment = ExperimentFactory.build()
self.assertFalse(experiment.completed_overview)

def test_overview_is_complete_when_saved(self):
experiment = ExperimentFactory.create()
self.assertTrue(experiment.completed_overview)

def test_population_is_not_complete_when_defaults_set(self):
experiment = ExperimentFactory.create(
population_percent=0.0, firefox_version="", firefox_channel=""
Expand Down

0 comments on commit 4e8d19f

Please sign in to comment.