Exemple #1
0
    def setUp(self):
        self.user = UserFactory(username='******', password='******')
        self.other_user = UserFactory(username='******', password='******')

        self.action = ActionFactory(user=self.user)
        self.action1 = ActionFactory(user=self.other_user)
        actions = [self.action, self.action1]

        for action in actions:
            for _ in range(1, 10):
                RecordFactory(action=action)

        self.url = '/records'
Exemple #2
0
 def setUp(self):
     self.user = UserFactory(username='******', password='******')
     self.other = UserFactory(username='******', password='******')
     self.action = ActionFactory(user=self.user)
     self.goal = GoalFactory(action=self.action)
     self.url = '/goal/update/action/{}'.format(
         self.action.id)
     self.object = {'action': self.action,
                    'daily_value': 100}
Exemple #3
0
class ActionTest(TestCase):

    def setUp(self):
        self.action = ActionFactory()

    def test_str(self):
        self.assertEqual(self.action.__str__(), '{} ({})'.format(
            self.action.text,
            self.action.unit
        ))
Exemple #4
0
    def setUp(self):
        self.user = UserFactory(username='******', password='******')
        self.other_user = UserFactory(username='******', password='******')
        users = [self.user, self.other_user]

        for user in users:
            for _ in range(1, 10):
                ActionFactory(user=user)

        self.url = '/actions'
Exemple #5
0
    def setUp(self):
        self.user = UserFactory(username='******', password='******')
        self.other_user = UserFactory(username='******', password='******')

        self.object = {
            'text': 'Book Reading',
            'color': 1,
            'unit': 'pages',
            'user': self.user
        }

        self.action = ActionFactory(**self.object)
        self.url = '/record-create'

        self.new_record = {'action': self.action.id, 'value': 100}
Exemple #6
0
    def setUp(self):
        self.user = UserFactory(username='******', password='******')
        self.other_user = UserFactory(username='******', password='******')

        self.object = {'text': 'Action', 'color': 2, 'unit': 'unit'}

        self.action = ActionFactory(user=self.user, **self.object)

        self.update_object = {
            'text': 'Book Reading',
            'color': 1,
            'unit': 'pages'
        }

        self.url = '/action-update/{}'.format(self.action.id)
Exemple #7
0
 def setUp(self):
     self.user = UserFactory(username='******', password='******')
     self.action = ActionFactory(user=self.user)
Exemple #8
0
 def setUp(self):
     self.action = ActionFactory()
Exemple #9
0
 def setUp(self):
     self.user = UserFactory(username='******', password='******')
     self.other_user = UserFactory(username='******', password='******')
     self.action = ActionFactory(user=self.user)
     self.url = '/action-delete/{}'.format(self.action.id)