'Variables in Google Test Fixtures

Why TEST_F can access the member variable in a class without using any scopes? e.g.,

class ABC : public ::testing::Test
{
protected:
     int a;
     int b;
     void SetUp()
     {      
         a = 1;
         b = 1;
     }

     virtual void TearDown()
     { 
     }
};

TEST_F(ABC, Test123)
{
    ASSERT_TRUE(a == b);

}

why it can directly access a and b, instead of using ABC::a or ABC::b? Does the fixture create a variable for class ABC? if so, should it be ASSERT_TRUE(abc.a == abc.b); instead of ASSERT_TRUE(a == b);?



Solution 1:[1]

You won't be able to redirect from flask on a POST request. Instead use return 200

Then the success function in your Ajax request should trigger.

If you need more flexibility, you can also return json data to the "success" or "error" function. return json.dumps({'success' : True}), 200, {'ContentType' : 'application/json'}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Lewis Bamboo